Guest User

Untitled

a guest
Dec 11th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. // debounce :: Number -> (Args -> Any) -> (Args -> Undefined)
  2. // Args = Any
  3. export const debounce = time => (fn) => {
  4. let timeout;
  5. return (...args) => {
  6. clearTimeout(timeout);
  7. timeout = setTimeout(() => fn(...args), time);
  8. };
  9. };
Add Comment
Please, Sign In to add comment