-
I want to limit the lifespan of streams created by Can someone post a short pseudo-code example on how it is intended to be used? :) Edit: I found a blog post which explains it quite well: I also found a blog-post where the author explained it quite well: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've never used it, but you can see on the tests for an example: https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/spec/operators/groupBy-spec.ts#L91 It looks like you can return an observable that says when the group should be closed. On this example, it's using the same stream to say that it should get killed after the second emission. If a new value comes through the stream for that group, a new group will be created. |
Beta Was this translation helpful? Give feedback.
I've never used it, but you can see on the tests for an example: https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/spec/operators/groupBy-spec.ts#L91
It looks like you can return an observable that says when the group should be closed. On this example, it's using the same stream to say that it should get killed after the second emission.
If a new value comes through the stream for that group, a new group will be created.