Created
November 1, 2014 21:20
-
-
Save rafkhan/1d46278f10c934c1e55e 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
var process = function(f) { | |
var gen = f(); | |
var nextVal = function(lastVal) { | |
var itr = gen.next(lastVal); | |
if(itr.done) { return; } | |
itr.value.then(nextVal); | |
}; | |
nextVal(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment