Skip to content

Conversation

@laggingreflex
Copy link

checks if the last argument provided was a function
if so, it calls the original function as is
if not, it returns a promise whose resolve function is
passed as the callback to the original function
thus resolving the promise when function returns a value

(relies on native Promise implementation)
if Promise is undefined, it calls original function as is

@laggingreflex laggingreflex force-pushed the promise branch 9 times, most recently from 838e750 to 12337f2 Compare February 2, 2016 15:29
checks if the last argument provided was a function
  if so, it calls the original function as is
  if not, it returns a promise whose `resolve` function is
    passed as the callback to the original function
    thus resolving the promise when function returns a value

(relies on native Promise implementation)
  if Promise is undefined, it calls original function as is
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant