mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
14 lines
319 B
TypeScript
14 lines
319 B
TypeScript
|
|
import debounce from "debounce";
|
|
|
|
const doThings = () => 1;
|
|
|
|
debounce(function(){ doThings(); })();
|
|
|
|
debounce(function(){ doThings(); }, 1000)();
|
|
|
|
debounce(function(a: string){ doThings(); }, 1000)("foo");
|
|
|
|
// Immediate true should return the value
|
|
const imm1: number = (debounce((x: number) => x * 2, 100, true))(2);
|