Performs an operation on all the input promises and returns a promise that has the shape of the input and contains the result of the operation that has been performed on each input.
Syntax
promise.theneach(values, complete, error, progress).done( /* Your success and error handlers */ );
Parameters
- values
-
Type: Object
A set of values (which could be either an array or an object) of which some or all are promises..
- complete
-
Type: Function
The function to be called if the promise is fulfilled with a value. This function takes a single argument, which is the fulfilled value of the promise.
- error
-
Type: Function
The function to be called if the promise is fulfilled with an error. This function takes a single argument, which is the error value of the promise.
- progress
-
Type: Function
The function to be called if the promise reports progress. This function takes a single argument, which is the data about the progress of the promise. Promises are not required to support progress.
Return value
Type: Promise
A Promise that is the result of calling join on the values parameter.
Remarks
WinJS.Promise.theneach(promises, completeFunction, errorFunction, progressFunction);
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
WinJS |
|
Library |
|
See also
Build date: 12/5/2012