This code gives me this error
Warning: a promise was created in a handler but none were returned from it
var Observable = Rx.Observable;
var source = Observable.range(0, 3);
source
.flatMap(item => {
console.log('getting first promise');
return Observable.fromPromise(
new Promise((resolve, reject) => {
resolve(5)
})
);
})
.flatMap(item => {
console.log('item ==', item);
console.log('getting second promise');
return Observable.fromPromise(
new Promise((resolve, reject) => {
resolve(4)
})
);
})
.subscribe(x => console.log('sub1 == ', x));
If you delete the second statement flatMap, I will not get an error. Why does the second RxJS flatMap statement raise a Bluebird warning, but the first FlatMap is missing? And of course, what do I need to fix in the way I use Bluebird Promises?
Here is Plunk , which demonstrates the problem, you will see warnings in the Chrome Developer Console
source
share