Use RxJS mapTo and map to Transform Values Emitted by Observables

Share this video with your friends

Send Tweet

transforming the values emitted by observables. We made our first operator called multiplyBy, which looks a bit useful, but in practice we don't need it because it's too specific: it only does simple multiplication on numbers. In this lesson we will see how the map() operator is useful for any calculation on delivered values.

🚨 Since we are importing interval from RxJS, we don't need to preface our Observables with Rx.Observable. You can no longer .{operator}, you need to .pipe({operator}) instead.

Vance
Vance
~ 7 years ago

would we actually monkey patch Observable with our own methods in reality? I'm guessing this is just rhetorical/socratic.