Last active
September 26, 2015 08:33
-
-
Save shadeglare/ac8f7fa75f523029f043 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/// <reference path="./../typings/tsd.d.ts"/> | |
/// <reference path="./../node_modules/rx/ts/rx.all.d.ts"/> | |
import * as Rx from "rx"; | |
import * as Bacon from "baconjs"; | |
let rxstream = new Rx.Subject<string>(); | |
let rxdispatcher = rxstream.do(_ => console.log("rxdo")); | |
rxdispatcher.subscribe(console.log); | |
rxdispatcher.subscribe(console.log); | |
rxstream.onNext("rxpayload"); | |
let bstream = new Bacon.Bus<string, any>(); | |
let bdispatcher = bstream.doAction(_ => console.log("bdo")); | |
bdispatcher.onValue(console.log); | |
bdispatcher.onValue(console.log); | |
bstream.push("bpayload"); | |
/* output: | |
rxdo | |
rxpayload | |
rxdo | |
rxpayload | |
bdo | |
bpayload | |
bpayload | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment