How to use rx.throw:
GitHub: hybridables/merz
19 20 21 22 23 24 25 26 27 28 29 30
function successValue () { return Observable.return([1, 2, 3]) } function failure () { return Observable.throw(new Error('observable error')) } test('should handle a finished empty observable', function (done) { merz(success)(function (err, res) {
How to use rx.empty:
GitHub: hybridables/merz
11 12 13 14 15 16 17 18 19 20 21 22
var test = require('assertit') var Observable = require('rx').Observable var merz = require('../index') function success () { return Observable.empty() } function successValue () { return Observable.return([1, 2, 3])
How to use rx.return:
GitHub: hybridables/merz
15 16 17 18 19 20 21 22 23 24 25 26
function success () { return Observable.empty() } function successValue () { return Observable.return([1, 2, 3]) } function failure () { return Observable.throw(new Error('observable error'))