Skip to content

Instantly share code, notes, and snippets.

@edulan
edulan / rx_photobooth.js
Last active April 19, 2018 15:32
Rx photobooth, take 4 photos with a 5 seconds countdown between them
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())
)
@javisantana
javisantana / bb.js
Created February 1, 2012 09:50
backbone signals
var f = _.after(2, function() {
// do something with both collections
});
this.collection1.bind('reset', f);
this.collection2.bind('reset', f);