Lines Matching defs:resolve
19 function resolve($promiseOrValue = null)
34 return new Promise(function ($resolve, $reject, $notify) use ($promiseOrValue) {
35 $promiseOrValue->then($resolve, $reject, $notify);
61 return resolve($promiseOrValue)->then(function ($value) {
70 * Returns a promise that will resolve only once all the items in
100 return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $cancellationQueue) {
101 resolve($promisesOrValues)
102 ->done(function ($array) use ($cancellationQueue, $resolve, $reject, $notify) {
104 $resolve();
111 resolve($promiseOrValue)
112 ->done($resolve, $reject, $notify);
119 * Returns a promise that will resolve when any one of the items in
141 * Returns a promise that will resolve when `$howMany` of the supplied items in
142 * `$promisesOrValues` resolve. The resolution value of the returned promise
147 * to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items
163 return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $howMany, $cancellationQueue) {
164 resolve($promisesOrValues)
165 ->done(function ($array) use ($howMany, $cancellationQueue, $resolve, $reject, $notify) {
167 $resolve([]);
191 $fulfiller = function ($val) use ($i, &$values, &$toResolve, $toReject, $resolve) {
199 $resolve($values);
217 resolve($promiseOrValue)
240 return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $mapFunc, $cancellationQueue) {
241 resolve($promisesOrValues)
242 ->done(function ($array) use ($mapFunc, $cancellationQueue, $resolve, $reject, $notify) {
244 $resolve([]);
255 resolve($promiseOrValue)
258 function ($mapped) use ($i, &$values, &$toResolve, $resolve) {
262 $resolve($values);
289 return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $reduceFunc, $initialValue, $cancellationQueue) {
290 resolve($promisesOrValues)
291 ->done(function ($array) use ($reduceFunc, $initialValue, $cancellationQueue, $resolve, $reject, $notify) {
306 return resolve($val)
315 \array_reduce($array, $wrappedReduceFunc, resolve($initialValue))
316 ->done($resolve, $reject, $notify);