Skip to content

Instantly share code, notes, and snippets.

@randallb
Created June 8, 2016 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randallb/5207292481b6098a2fc12aa0f87a8011 to your computer and use it in GitHub Desktop.
Save randallb/5207292481b6098a2fc12aa0f87a8011 to your computer and use it in GitHub Desktop.
// bad i think?
function currentUserStream () {
return Rx.Observable.create((o) => {
const fn = () => {
o.next(Math.random());
};
setInterval(fn, 250);
}).take(11).share();
}
module.exports = {
currentUserStream: currentUserStream(),
};
//good i think?
function currentUserStream () {
return Rx.Observable.create((o) => {
const fn = () => {
o.next(Math.random());
};
setInterval(fn, 500);
}).take(11);
}
module.exports = {
currentUserStream,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment