Skip to content

Instantly share code, notes, and snippets.

@briancavalier
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save briancavalier/ef3133f9a817adb420ca to your computer and use it in GitHub Desktop.

Select an option

Save briancavalier/ef3133f9a817adb420ca to your computer and use it in GitHub Desktop.
var most = require('../most');
// A stream of periodic events
var s = most.periodic(100);
// A "timespan"
var timespan = most.of(most.of().delay(1000)).delay(5000);
// Log only events within the timespace
within(timespan, s).observe(console.log);
function within(timespan, stream) {
return stream.since(timespan).until(timespan.join());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment