Method Concurrent.AggregatedPromise()->fold()
- Method
fold
 
- this_program(<- ValueType>) fold(- mixed- initial,- function(- mixed,- mixed,- __unknown__... :- mixed)- fun,- mixed...- extra)
- Parameter initial
- Initial value of the accumulator. 
- Parameter fun
- Function to apply. The first argument is the result of one of the - futures. The second argument is the current value of the accumulator.
- Parameter extra
- Any extra context needed for - fun. They will be provided as arguments three and onwards when- funis called.
- Returns
- The new Promise. 
- Note
- If - funthrows an error it will fail the Future.
- Note
- funmay be called in any order, and will be called once for every Future it depends upon, unless one of the calls fails in which case no further calls will be performed.
- See also