This file contains 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
var Rx = require('rx'); | |
var s = new Rx.Subject(); | |
var r = s.asObservable().replay(); | |
r.connect(); | |
s.onNext(1); | |
s.onNext(2); |
This file contains 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
var Rx = require('rx'); | |
var e1 = new Rx.Subject(); | |
var e2 = new Rx.Subject(); | |
var e3 = new Rx.Subject(); | |
var e1s = e1.asObservable(); | |
var e2s = e2.asObservable(); | |
var e3s = e3.asObservable(); |
This file contains 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
var Rx = require('rx'); | |
var e1 = new Rx.Subject(); | |
var e2 = new Rx.Subject(); | |
var e3 = new Rx.Subject(); | |
var e1s = e1.asObservable(); | |
var e2s = e2.asObservable(); | |
var e3s = e3.asObservable(); |
This file contains 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
var Rx = require('rx'); | |
var e1 = new Rx.Subject(); | |
var e2 = new Rx.Subject(); | |
var e3 = new Rx.Subject(); | |
var e1s = e1.asObservable(); | |
var e2s = e2.asObservable(); | |
var e3s = e3.asObservable(); |
This file contains 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
profileSwitchSuccesses. | |
startWith(true). | |
flatMapLatest(function () { | |
return cacheExpiryInHomeOnForegrounds. | |
flatMapLatest(function() { | |
return EventManager.observe(EventManager.APP.EVENT_LOGIN_CHECK_DONE). | |
take(1). | |
filter(isLoggedIn); | |
}); | |
}). |
This file contains 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
var Rx = require('rx'); | |
var profileSwitchSuccess = new Rx.Subject(); | |
var cacheExpiryInHomeOnForeground = new Rx.Subject(); | |
var loginCheckDone = new Rx.Subject(); | |
profileSwitchSuccess.asObservable(). | |
do(function () { | |
console.log('profile switch success'); | |
}). |
This file contains 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
var Rx = require('rx'); | |
var profileSwitchSuccess = new Rx.Subject(); | |
var cacheExpiryInHomeOnForeground = new Rx.Subject(); | |
var loginCheckDone = new Rx.Subject(); | |
profileSwitchSuccess.asObservable(). | |
map(function () { | |
return true; | |
}). |
This file contains 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
var Rx = require('rx'); | |
var subjects = {}; | |
function create(sn) { | |
var s = new Rx.Subject(); | |
subjects[sn] = s; |
This file contains 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
var Rx = require('rx'); | |
var throwErrors = Rx.Observable.throw(new Error('tiny url exploded')); | |
throwErrors. | |
do( | |
function () {}, | |
function () { | |
console.log('handle error'); | |
} |
This file contains 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
var Rx = require('rx'); | |
var s1 = new Rx.Subject(); | |
var s2 = new Rx.Subject(); | |
var s3 = new Rx.Subject(); | |
Rx.Observable.merge(s1, s2, s3). | |
forEach( | |
console.log.bind(console, 'next'), | |
console.log.bind(console, 'error'), |
OlderNewer