Skip to content

Instantly share code, notes, and snippets.

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

  • Save wilfrem/0f961c9e86979e2837a8 to your computer and use it in GitHub Desktop.

Select an option

Save wilfrem/0f961c9e86979e2837a8 to your computer and use it in GitHub Desktop.

Revisions

  1. wilfrem revised this gist Apr 5, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions rxSideEffect.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,10 @@


    var rx = require("rx");
    var s = new rx.Subject();
    var stream = s.tap(function(){console.log("side effect");});
    stream.subscribeOnNext(function(){});
    stream.subscribeOnNext(function(){});
    s.onNext("foo");


  2. wilfrem created this gist Apr 5, 2015.
    6 changes: 6 additions & 0 deletions rxSideEffect.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    var rx = require("rx");
    var s = new rx.Subject();
    var stream = s.tap(function(){console.log("side effect");});
    stream.subscribeOnNext(function(){});
    stream.subscribeOnNext(function(){});
    s.onNext("foo");