Guest User

Untitled

a guest
Jan 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. internal class GroupByOperator<TSource, TKey> : IObservable<IGroupedObservable<TKey, TSource>>
  2. {
  3. private IObservable<TSource> source;
  4. private Func<TSource, TKey> keySelector;
  5. public GroupByOperator(IObservable<TSource> source, Func<TSource, TKey> keySelector)
  6. {
  7. this.source = source;
  8. this.keySelector = keySelector;
  9. }
  10.  
  11. public IDisposable Subscribe(IObserver<IGroupedObservable<TKey, TSource>> observer)
  12. {
  13. var grouper = new Grouper(observer, this.keySelector);
  14. return source.Subscribe(grouper);
  15. }
Add Comment
Please, Sign In to add comment