mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
add usage-warning to debounce-util
This commit is contained in:
parent
63cb496df6
commit
447887fae9
|
@ -146,16 +146,18 @@ export namespace Event {
|
|||
}
|
||||
|
||||
/**
|
||||
* @deprecated DO NOT use, this leaks memory
|
||||
* *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
|
||||
* event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
|
||||
* returned event causes this utility to leak a listener on the original event.
|
||||
*/
|
||||
export function debounce<T>(event: Event<T>, merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<T>;
|
||||
/**
|
||||
* @deprecated DO NOT use, this leaks memory
|
||||
* *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
|
||||
* event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
|
||||
* returned event causes this utility to leak a listener on the original event.
|
||||
*/
|
||||
export function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number, leading?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O>;
|
||||
/**
|
||||
* @deprecated DO NOT use, this leaks memory
|
||||
*/
|
||||
|
||||
export function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay: number = 100, leading = false, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O> {
|
||||
|
||||
let subscription: IDisposable;
|
||||
|
|
Loading…
Reference in a new issue