rxjs Observable .map not executing
The map is never executed because it creates an observable that stays cold (no subscription).
Add an empty subscribe()
and it should work.
observable$.map(res => {
console.warn ("IN MAP: " + JSON.stringify(res));
}).subscribe();
And another tip on rxjs debugging, if you want to peek into the value, you can always use the do
operator (instead of your map
).
observable$
.do((v) => console.log('debug point: ', v)) // <-- this is the addition.
.subscribe(...your original handlers go here ...)