Skip to content

Instantly share code, notes, and snippets.

@knjname
Created August 14, 2012 11:03
Show Gist options
  • Save knjname/3348173 to your computer and use it in GitHub Desktop.
Save knjname/3348173 to your computer and use it in GitHub Desktop.
deferredize = (obj)->
obj = obj() if typeof obj is 'function'
def = $.Deferred()
obj.onsuccess = (args...)-> def.resolve args...
obj.onerror = (args...) -> def.reject args...
@knjname
Copy link
Author

knjname commented Aug 14, 2012

missing return def

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment