mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
16 lines
337 B
TypeScript
16 lines
337 B
TypeScript
import debounce = require("debounce");
|
|
|
|
const doThings = () => 1;
|
|
|
|
debounce(doThings)();
|
|
|
|
debounce(doThings, 1000)();
|
|
|
|
debounce((a: string) => doThings, 1000)("foo");
|
|
|
|
// Immediate true should return the value
|
|
const imm1: number = (debounce((x: number) => x * 2, 100, true))(2);
|
|
|
|
const clearable = debounce(doThings);
|
|
clearable.clear();
|