mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-09 03:30:09 +00:00
added _(...).debounce def
This commit is contained in:
@@ -518,19 +518,29 @@ result = <_.LoDashWrapper<Function>>_(function(a, b, c) {
|
||||
console.log(a + b + c);
|
||||
}).curry();
|
||||
|
||||
var lazyLayout: Function = _.debounce(function() {}, 150);
|
||||
jQuery(window).on('resize', lazyLayout);
|
||||
declare var source;
|
||||
result = <Function>_.debounce(function() {}, 150);
|
||||
|
||||
jQuery('#postbox').on('click', <Function>_.debounce(function() {}, 300, {
|
||||
'leading': true,
|
||||
'trailing': false
|
||||
}));
|
||||
|
||||
declare var source;
|
||||
source.addEventListener('message', <Function>_.debounce(function() {}, 250, {
|
||||
'maxWait': 1000
|
||||
}), false);
|
||||
|
||||
result = <_.LoDashWrapper<Function>>_(function() {}).debounce(150);
|
||||
|
||||
jQuery('#postbox').on('click', <_.LoDashWrapper<Function>>_(function() {}).debounce(300, {
|
||||
'leading': true,
|
||||
'trailing': false
|
||||
}));
|
||||
|
||||
source.addEventListener('message', <_.LoDashWrapper<Function>>_(function() {}).debounce(250, {
|
||||
'maxWait': 1000
|
||||
}), false);
|
||||
|
||||
result = <number>_.defer(function() { console.log('deferred'); });
|
||||
|
||||
var log = _.bind(console.log, console);
|
||||
|
||||
11
lodash/lodash.d.ts
vendored
11
lodash/lodash.d.ts
vendored
@@ -2107,7 +2107,16 @@ declare module _ {
|
||||
export function debounce(
|
||||
func: Function,
|
||||
wait: number,
|
||||
options?: DebounceSettings): Function;
|
||||
options?: DebounceSettings): Function;
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.debounce
|
||||
**/
|
||||
debounce(
|
||||
wait: number,
|
||||
options?: DebounceSettings): LoDashWrapper<Function>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defers executing the func function until the current call stack has cleared. Additional
|
||||
|
||||
Reference in New Issue
Block a user