filter
Last updated
Last updated
filter(select: Function, thisArg: any): Observable
💡 If you would like to complete an observable when a condition fails, check out takeWhile!
Example 1: filter for even numbers
( StackBlitz | jsBin | jsFiddle )
Example 2: filter objects based on property
( StackBlitz | jsBin | jsFiddle )
Example 3: filter for number greater than specified value
( StackBlitz | jsBin | jsFiddle )
filter 📰 - Official docs
filter - In Depth Dev Reference
Adding conditional logic with filter 🎥 💵 - John Linquist
Filtering operator: filter 🎥 💵 - André Staltz
Build your own filter operator 🎥 - Kwinten Pisman
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/filter.ts