Skip to content

Instantly share code, notes, and snippets.

@costa
Created November 25, 2014 11:08
Show Gist options
  • Select an option

  • Save costa/54cf947bbb4d5a63b77e to your computer and use it in GitHub Desktop.

Select an option

Save costa/54cf947bbb4d5a63b77e to your computer and use it in GitHub Desktop.
Client-side asynchronous pusher init utility: app/assets/javascripts
window.pusher_async = (pusher_or_key, callback)->
return _(pusher_async).delay 22, key unless Pusher?
callback if typeof pusher_or_key is 'string' then new Pusher pusher_or_key else pusher_or_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment