Created
May 29, 2017 15:20
-
-
Save wyeo/386fc4cdcbc0013f9066f77c323c5990 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
Observable.interval = (period) => { | |
Observable.prototype.subscribe = (nextFn) => { | |
let i = 0 | |
const timeout = setInterval((function(){ nextFn(i++) }), period) | |
return clearInterval.bind(null, timeout) | |
} | |
return new Observable() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment