Skip to content

Instantly share code, notes, and snippets.

@zackbloom
Created May 12, 2014 20:17
Show Gist options
  • Select an option

  • Save zackbloom/1f6e14cb8368c77550bb to your computer and use it in GitHub Desktop.

Select an option

Save zackbloom/1f6e14cb8368c77550bb to your computer and use it in GitHub Desktop.
first = (promises...) ->
out = $q.defer()
for promise in promises
promise.then(out.resolve, out.reject)
out
timeoutIn = (delay) ->
$timeout(-> 'timed out', delay)
first = (currentUser.$promise, $timeout(2000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment