mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Accept timeout option to waitsForPromise
This commit is contained in:
@@ -160,12 +160,12 @@ window.mousemoveEvent = (properties={}) ->
|
||||
|
||||
window.waitsForPromise = (args...) ->
|
||||
if args.length > 1
|
||||
{ shouldReject } = args[0]
|
||||
{ shouldReject, timeout } = args[0]
|
||||
else
|
||||
shouldReject = false
|
||||
fn = _.last(args)
|
||||
|
||||
window.waitsFor (moveOn) ->
|
||||
window.waitsFor timeout, (moveOn) ->
|
||||
promise = fn()
|
||||
if shouldReject
|
||||
promise.fail(moveOn)
|
||||
|
||||
Reference in New Issue
Block a user