fix always call onNext
use defaultIfEmpty to prevent filtering from collapsing observable pipeline early
This commit is contained in:
@ -41,14 +41,16 @@ module.exports = function(app) {
|
|||||||
.flatMap(function(user) {
|
.flatMap(function(user) {
|
||||||
debug('saving user');
|
debug('saving user');
|
||||||
return saveUser(user);
|
return saveUser(user);
|
||||||
});
|
})
|
||||||
|
// always call onNext
|
||||||
|
.defaultIfEmpty(null);
|
||||||
|
|
||||||
var query = { where: { dashedName: { like: dashedName, options: 'i' } } };
|
var query = { where: { dashedName: { like: dashedName, options: 'i' } } };
|
||||||
|
|
||||||
debug('find fieldGuide', query);
|
debug('find fieldGuide', query);
|
||||||
Rx.Observable.combineLatest(
|
Rx.Observable.combineLatest(
|
||||||
// find that field guide
|
// find that field guide
|
||||||
findOneFieldGuide(query).tap(function() { console.log('foo'); }),
|
findOneFieldGuide(query),
|
||||||
userSave,
|
userSave,
|
||||||
Rx.helpers.identity
|
Rx.helpers.identity
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user