You mix a few things, I think. Observers always have factor time in them, so you do something with the help of what is observed over time. If you want to group things in a static array, then observables are the wrong approach.
In your case, you have several dats
const tasks = [ {due: "2016-01-01"} , {due: "2016-01-01"} , {due: "2016-01-02"} ];
If you are going to put them in an Observable, it is possible, but it will simply output the array once and that is it.
const observable = Rx.Observable.of(tasks); observable.subscribe(x => console.log('All at once', x));
If you want to spread them in time - and now we are approaching what we observe for you, you can also do this
const observable2 = Rx.Observable.from(tasks); observable2.subscribe(x => console.log('One after the other', x));
Now suppose we have a data source that provides a new task from time to time, and we want to group them over time. Here's what it looks like:
const observable3 = Rx.Observable.from(tasks); observable3 .scan((acc, obj) => { let oldValue = acc[obj.due] || 0; acc[obj.due] = ++oldValue; return acc; }, {}) .subscribe(x => console.log(x));
So, depending on your needs. Observations may be correct. If the data is distributed over time, it is possible to group them as shown above. I uploaded the code to jsbin to play with it.