UNPKG
rapid
Version:
latest (3.1.1)
3.1.1
3.1.0
3.0.0
2.0.0
1.1.0
1.0.0
0.0.2
0.0.1
A simple tool for rapidly creating components
github.com/jonathantneal/rapid
jonathantneal/rapid
rapid
/
lib
/
debounce.js
13 lines
(10 loc)
•
204 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
// postponed execution
module
.
exports
=
(
fn, delay
) =>
{
let
timeout =
null
;
return
(
...args
) =>
{
clearTimeout
(timeout); timeout =
setTimeout
(
() =>
{ fn.
apply
(
this
, args); }, delay); }; };