Filter Events Based on a Predicate with RxJS filter

Share this video with your friends

Send Tweet

through a predicate function that tells what is the criteria to pass or reject an event. This lesson introduces filter: an operator that allows us to let only certain events pass, while ignoring others.

🚨 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.

Erkan Buelbuel
Erkan Buelbuel
~ 8 years ago

Why don't you use iterable JSON structures in your demos? Nobody would use "Observables" for primitive arrays.

André Staltz
André Staltz(instructor)
~ 8 years ago

Hi EBIA,

Which arrays are you referring to in this lesson?

Daniel Laubacher
Daniel Laubacher
~ 5 years ago

I would like to note that this isn't Rx 6 friendly. You'll need to use these concepts with slightly different imports and usage.