- Preparing search index...
- The search index is not available
@w11k/rx-ninja
- debounceIf<T>(debounceTimeInMs, predicate, scheduler?): ((source) => Observable<undefined | T>)
-
Parameters
-
debounceTimeInMs: number
-
predicate: ((previous, last) => boolean)
-
- (previous, last): boolean
-
Parameters
-
previous: undefined | T
-
last: T
Returns boolean
-
Optional
scheduler: SchedulerLike
Returns ((source) => Observable<undefined | T>)
-
- (source): Observable<undefined | T>
-
Returns Observable<undefined | T>
Debounce values on the stream if the predicate returns true.
Examples:
Example 1
debounceTimeInMs: don't matter in this example predicate:
() => false
Example 2
10ms equals 1 frame debounceTimeInMs:
10
predicate:() => true
Example 3 Debounce only on even values
10ms equals 1 frame debounceTimeInMs:
10
predicate:(_, a) => a % 2 === 0