Created
July 17, 2015 03:01
-
-
Save yelouafi/9edf4125e95ccd4b107b to your computer and use it in GitHub Desktop.
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
// sequence of elements from an array that occur at a fixed interval | |
// starting after an initial delay | |
// yields 1, 2 and 3 each second starting after five seconds | |
Stream.seq([1,2,3], 5000, 1000) | |
//stream of DOM events that occur until a promise is completed | |
// receives click events for 10 seconds | |
Stream.fromDomEvent(document.body, 'click', delay(10000) ) | |
// Node events can also be thought as (possibly infinite) streams | |
var server = http.createServer(); | |
Stream.fromEmitter(server, 'request') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment