dojo/promise/first

Summary

Takes multiple promises and returns a new promise that is fulfilled when the first of these promises is fulfilled.

Takes multiple promises and returns a new promise that is fulfilled when the first of these promises is fulfilled. Canceling the returned promise will not cancel any passed promises. The promise will be fulfilled with the value of the first fulfilled promise.

Usage

first(objectOrArray);
Parameter Type Description
objectOrArray Object | Array
Optional

The promises are taken from the array or object values. If no value is passed, the returned promise is resolved with an undefined value.

Returns: dojo/promise/Promise

See the dojo/promise/first reference documentation for more information.

Methods

© 2005–2017 JS Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/promise/first.html