ReactiveX: Group and Buffer only last item in each group
问题 How to group an Observable, and from each GroupedObservable keep in memory only the last emitted item? So that each group would behave just like BehaviorSubject. Something like this: {user: 1, msg: "Anyone here?"} {user: 2, msg: "Hi"} {user: 2, msg: "How are you?"} {user: 1, msg: "Hello"} {user: 1, msg: "Good"} So in memory we'd have only have the last item for each user : {user: 2, msg: "How are you?"} {user: 1, msg: "Good"} And when a subscriber subscribes, these two items were issued right