Guest User

Untitled

a guest
Jan 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. // a simple version of _.debounce
  2.  
  3. let debounce = (func, time) => {
  4. let timeout
  5. let f = (args) => {
  6. clearTimeout(timeout)
  7. timeout = setTimeout(() => {
  8. func(args)
  9. }, time)
  10. }
  11. return f
  12. }
Add Comment
Please, Sign In to add comment