Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delayWhen is deprecated RxJs

I got a Deprecated symbol used ... warning inside my IDE for using delayWhen in my app.

enter image description here

My code:

private nextImg(): Observable<void> {
    return this.stream$.pipe(
          delayWhen(() => timer(1000),
          tap(() => this.subject.next(NEXT_IMG)),
         );
}

I've checked the source code of the delayWhen operator and the docs as well, but I can't find what to use instead of delayWhen. Any idea?

like image 340
Runtime Terror Avatar asked Oct 04 '18 05:10

Runtime Terror


1 Answers

The delayWhen operator isn't deprecated, only the function overload is marked as deprecated.

@deprecated In future versions, empty notifiers will no longer re-emit the source value on the output observable.

So your IDE mistakenly marks the hole operator as deprecated.

like image 65
cyr_x Avatar answered Oct 21 '22 09:10

cyr_x