Created
June 1, 2016 10:18
-
-
Save DooVDe/44b7166befc8f3704e15506854826cd9 to your computer and use it in GitHub Desktop.
This file contains 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
function getStreamWrapper() { | |
function getStream(pool) { | |
return Kefir | |
.sequentially(1000, [1, 2, 3]) | |
.onEnd(function(){ | |
pool.plug(getStream(pool)); | |
}); | |
} | |
var pool = Kefir.pool(); | |
getStream(pool); | |
pool.plug(stream); | |
return pool; | |
} | |
getStreamWrapper().log() | |
function getStream () { | |
var stream = Kefir.sequentially(0, [1, 2, 3]); | |
var end = stream | |
.last() | |
.flatMapLatest(getStream); | |
return stream.merge(end); | |
} | |
getStream().log(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment