-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Xenira/Shashki
#66Description
Here’s the current signature for debounce():
rxjs/src/operators/debounce.ts
Line 53 in c1721e3
| export function debounce<T>(durationSelector: (value: T) => SubscribableOrPromise<number>): MonoTypeOperatorFunction<T> { |
One thing that confused me is that it asks for your function to return a SubscribableOrPromise<number>. The documentation compounded my confusion ("A function (…) for computing the timeout duration for each source value”): is my selector supposed to return the number of milliseconds? Turns out the result of that observable/promise is completely discarded.
RxJS version: 5.5.6 (and, looking at the code, the next branch, too)
Additional information: throttle() has the same issue. Interestingly, audit() is correctly using SubscribableOrPromise<any>:
Line 52 in c1721e3
| export function audit<T>(durationSelector: (value: T) => SubscribableOrPromise<any>): MonoTypeOperatorFunction<T> { |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels