Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Observable {
- ...
- filter(predicate: (value) => boolean) {
- return new Observable(observer => {
- return this.subscribe({
- next(value) {
- if (predicate(value)) {
- observer.next(value);
- }
- },
- ...
- });
- });
- }
- }
Add Comment
Please, Sign In to add comment