Created
September 17, 2016 05:36
-
-
Save travenasty/b7bffe542165d437dfafe713c96f827d to your computer and use it in GitHub Desktop.
Question about the nature of a merged stream used within an .endWhen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const orbRelease$ = xs.merge( | |
| domCube.events('mouseout').filter( | |
| ev => ev.target.classList.contains('au-cube') | |
| ), | |
| domCube.events('mouseup'), | |
| domCube.events('touchend') | |
| ).debug(log.pass) | |
| const spin$ = dotTap$.map(tap => point$.endWhen( | |
| // ONLY EMITS ONCE AND COMPLETES, UNLESS xs.merge IS INLINE HERE IT WILL REMAIN INCOMPLETE AND CONTINUE EMITTING | |
| orbRelease$ | |
| )).flatten() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I move the xs.merge(...) to be inline the .endWhen(...) the next instance of spin$ works as expected and endsWhen the mouse is released or exits the "cube". However with the code as shown, it will only emit the value the first time... and the second pass-through the spin$ stream will never complete.