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
const takePhoto = () => new Promise((resolve) => (setTimeout(resolve, Math.random() * 1E3 + 5E2, 'photo'))) | |
const makeCountdown = (seconds) => | |
Rx.Observable | |
.concat( | |
Rx.Observable | |
.interval(1E3) | |
.take(seconds), | |
Rx.Observable.defer(() => takePhoto()) | |
) |
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 f = _.after(2, function() { | |
// do something with both collections | |
}); | |
this.collection1.bind('reset', f); | |
this.collection2.bind('reset', f); |