Skip to content

Instantly share code, notes, and snippets.

@jisaacks
Created September 26, 2014 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jisaacks/a1dd17cc4eb24273020d to your computer and use it in GitHub Desktop.
Save jisaacks/a1dd17cc4eb24273020d to your computer and use it in GitHub Desktop.
Debounce and merge params
(func, wait, immediate) ->
_params = {}
run = _.debounce ->
func(_params)
_params = {}
, wait, immediate
(params) ->
_params = _.extend(_params, params)
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment