Skip to content
View rx
var Rx = require('rx');
var pauses = new Rx.Subject();
var ends = new Rx.Subject();
pauses.
flatMap(function () {
return Rx.Observable.amb(
Rx.Observable.timer(1000).
map(function () { return true }),
ends.map(function () { return false })
View -
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'),
View -
var Rx = require('rx');
var throwErrors = Rx.Observable.throw(new Error('tiny url exploded'));
throwErrors.
do(
function () {},
function () {
console.log('handle error');
}
View -
var Rx = require('rx');
var subjects = {};
function create(sn) {
var s = new Rx.Subject();
subjects[sn] = s;
View foo.javascript
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;
}).
View foo.javascript
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');
}).
View foo.javascript
profileSwitchSuccesses.
startWith(true).
flatMapLatest(function () {
return cacheExpiryInHomeOnForegrounds.
flatMapLatest(function() {
return EventManager.observe(EventManager.APP.EVENT_LOGIN_CHECK_DONE).
take(1).
filter(isLoggedIn);
});
}).
View foo.javascript
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();
View -
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();
View -
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();
Something went wrong with that request. Please try again.