Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const modal$ = merge(
- show$.pipe(mapTo(true)),
- hide$.pipe(mapTo(false)),
- toggle$.pipe(mapTo(null))
- ).pipe(
- startWith(false),
- scan((acc, curr) => {
- if (curr === null) {
- return !acc;
- } else {
- return curr;
- }
- })
- );
Add Comment
Please, Sign In to add comment