[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/react/promise/src/ -> functions.php (summary)

(no description)

File Size: 351 lines (12 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 9 functions

  resolve()
  reject()
  all()
  race()
  any()
  some()
  map()
  reduce()
  _checkTypehint()

Functions
Functions that are not part of a class:

resolve($promiseOrValue = null)   X-Ref
Creates a promise for the supplied `$promiseOrValue`.

If `$promiseOrValue` is a value, it will be the resolution value of the
returned promise.

If `$promiseOrValue` is a thenable (any object that provides a `then()` method),
a trusted promise that follows the state of the thenable is returned.

If `$promiseOrValue` is a promise, it will be returned as is.

param: mixed $promiseOrValue
return: PromiseInterface

reject($promiseOrValue = null)   X-Ref
Creates a rejected promise for the supplied `$promiseOrValue`.

If `$promiseOrValue` is a value, it will be the rejection value of the
returned promise.

If `$promiseOrValue` is a promise, its completion value will be the rejected
value of the returned promise.

This can be useful in situations where you need to reject a promise without
throwing an exception. For example, it allows you to propagate a rejection with
the value of another promise.

param: mixed $promiseOrValue
return: PromiseInterface

all($promisesOrValues)   X-Ref
Returns a promise that will resolve only once all the items in
`$promisesOrValues` have resolved. The resolution value of the returned promise
will be an array containing the resolution values of each of the items in
`$promisesOrValues`.

param: array $promisesOrValues
return: PromiseInterface

race($promisesOrValues)   X-Ref
Initiates a competitive race that allows one winner. Returns a promise which is
resolved in the same way the first settled promise resolves.

The returned promise will become **infinitely pending** if  `$promisesOrValues`
contains 0 items.

param: array $promisesOrValues
return: PromiseInterface

any($promisesOrValues)   X-Ref
Returns a promise that will resolve when any one of the items in
`$promisesOrValues` resolves. The resolution value of the returned promise
will be the resolution value of the triggering item.

The returned promise will only reject if *all* items in `$promisesOrValues` are
rejected. The rejection value will be an array of all rejection reasons.

The returned promise will also reject with a `React\Promise\Exception\LengthException`
if `$promisesOrValues` contains 0 items.

param: array $promisesOrValues
return: PromiseInterface

some($promisesOrValues, $howMany)   X-Ref
Returns a promise that will resolve when `$howMany` of the supplied items in
`$promisesOrValues` resolve. The resolution value of the returned promise
will be an array of length `$howMany` containing the resolution values of the
triggering items.

The returned promise will reject if it becomes impossible for `$howMany` items
to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items
reject). The rejection value will be an array of
`(count($promisesOrValues) - $howMany) + 1` rejection reasons.

The returned promise will also reject with a `React\Promise\Exception\LengthException`
if `$promisesOrValues` contains less items than `$howMany`.

param: array $promisesOrValues
param: int $howMany
return: PromiseInterface

map($promisesOrValues, callable $mapFunc)   X-Ref
Traditional map function, similar to `array_map()`, but allows input to contain
promises and/or values, and `$mapFunc` may return either a value or a promise.

The map function receives each item as argument, where item is a fully resolved
value of a promise or value in `$promisesOrValues`.

param: array $promisesOrValues
param: callable $mapFunc
return: PromiseInterface

reduce($promisesOrValues, callable $reduceFunc, $initialValue = null)   X-Ref
No description

_checkTypehint(callable $callback, $object)   X-Ref




Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1