NetanelBasal
7/18/2018 - 7:56 PM

o-7.ts

class Observable {
  ...
  
  filter(predicate: (value) => boolean) {
    return new Observable(observer => {
      return this.subscribe({
        next(value) {
          if (predicate(value)) {
            observer.next(value);
          }
        },
        ...
      });
    });
  }

}