Created
January 31, 2013 21:13
-
-
Save raimohanska/4686503 to your computer and use it in GitHub Desktop.
Fold in Bacon.js
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
Bacon.Observable.prototype.fold = function(seed, f) { | |
var scanned = this.scan(seed, f) | |
return scanned.changes().mapEnd().map(scanned) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment