Allow tap operator after takeUntil
See original GitHub issueGive that tap
’s contract is that it can perform side effects but returns an identical Observable, is it not safe to follow a takeUntil
with a tap
(and thus allow it here)
e.g.
const stream$ = of().pipe(
...
takeUntil(unsubscribe$),
tap((datasets) => { setSomeState(true) })
)
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
how to take an action after takeUntil rxjs function
You can use the merge operator and reuse your takeUntil condition to create a mapped true value when the condition ( endtimer )...
Read more >takeUntil - Learn RxJS
import { takeUntil } from 'rxjs/operators';. . //emit value every 1s ... //when timer emits after 5s, complete source ... //only allow values...
Read more >How To Use the takeUntil RxJS Operator to Manage ...
Learn how to use the takeUntil operator to unsubscribe from observables when your Angular components are destroyed.
Read more >RxJS: Avoiding takeUntil Leaks - ncjamieson
Using the takeUntil operator to automatically unsubscribe from an observable is a mechanism that's explained in Ben Lesh's Don't Unsubscribe ...
Read more >tap - RxJS
Tap is designed to allow the developer a designated place to perform side effects. ... The tap operator is designed solely for such...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, there’s no race here, the unsubscription is synchronous.
No worries. At some stage, I’ll see if I can make some changes to the docs - and/or failure messages - to better explain what’s going on.