RxJs/NgRx - is there a way to “Cancel” a stream after the delay operator
问题 I am using a polling scheme in my Angular application using NgRx. To simplify things, I have something like the following... public stopPolling$ = createEffect(() => this.actions$.pipe( ofType(actions.stopPolling), tap(_ => this.isPollingActive = false), map(_ => actions.stopPolling()) ), { dispatch: false }); public continuePolling$ = createEffect(() => this.actions$.pipe( ofType(actions.getData), tap(_ => this.logger.debug('continue polling')), delay(8000), switchMap(_ => this.pollData()) )