This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable } from 'rxjs'; | |
// custom RxJS operator | |
// should be equivalent to the inspectTime operator that was removed from RxJS | |
export function inspectTime<T>(delay: number) { | |
return (source: Observable<T>): Observable<T> => { | |
return new Observable<T>(subscriber => { | |
let lastValue: T; | |
const action = () => subscriber.next(lastValue); | |
const throttle = ActionThrottle(action, delay); |