Lines Matching refs:to

47    * [How to use Deferred](#how-to-use-deferred)
118 Returns the promise of the deferred, which you can hand out to others while
119 keeping the authority to modify its state to yourself.
131 If `$value` itself is a promise, the promise will transition to the state of
156 Triggers progress notifications, to indicate to consumers that the computation
186 Transforms a promise's value by applying a function to the promise's fulfillment
198 wants) to indicate progress.
205 the same call to `then()`:
264 Additionally, you can type hint the `$reason` argument of `$onRejected` to catch
284 Allows you to execute "cleanup" type tasks in a promise chain.
286 It arranges for `$onFulfilledOrRejected` to be called, with no arguments,
300 `always()` behaves similarly to the synchronous finally statement. When combined
301 with `otherwise()`, `always()` allows you to write code that is similar to the familiar
341 A cancellable promise provides a mechanism for consumers to notify the creator
366 Creates a promise whose state is controlled by the functions passed to
399 fate will be equivalent to that of `$otherPromise`.
400 * `$reject($reason)` - Function that rejects the promise. It is recommended to
420 Note, that `$value` **cannot** be a promise. It's recommended to use
433 Note, that `$reason` **cannot** be a promise. It's recommended to use
467 is a promise which resolves to an array, this promise is also cancelled.
488 promise will be assimilated to a extended promise following `$promiseOrValue`.
504 This can be useful in situations where you need to reject a promise without
505 throwing an exception. For example, it allows you to propagate a rejection with
556 to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items
569 Traditional map function, similar to `array_map()`, but allows input to contain
581 Traditional reduce function, similar to `array_reduce()`, but input may contain
595 ### How to use Deferred
631 A few simple examples to show how the mechanics of Promises/A forwarding works.
638 Resolved promises forward resolution values to the next promise.
640 to `$deferred->resolve()` below.
642 Each call to `then()` returns a new promise that will resolve with the return
650 // $x will be the value passed to $deferred->resolve() below
678 Rejected promises behave similarly, and also work similarly to try/catch:
679 When you catch an exception, you must rethrow for it to propagate.
681 Similarly, when you handle a rejected promise, to propagate the rejection,
711 Just like try/catch, you can choose to propagate or not. Mixing resolutions and
741 **MUST** return a progress event to be propagated to the next link in the chain.
748 to the next link in the chain. The best thing to do is to ensure your progress
751 This gives you the opportunity to transform progress events at each step in the
752 chain so that they are meaningful to the next step. It also allows you to choose
753 not to transform them, and simply let them propagate untransformed, by not
779 The intent of `then()` is to transform a promise's value and to pass or return
780 a new promise for the transformed value along to other parts of your code.
782 The intent of `done()` is to consume a promise's value, transferring
783 responsibility for the value to your code.
785 In addition to transforming a value, `then()` allows you to recover from, or
787 by the promise machinery and used to reject the promise returned by `then()`.
789 Calling `done()` transfers all responsibility for errors to your code. If an
791 `$onFulfilled` or `$onRejected` callbacks you provide to done, it will be
799 // Transform API results to an object
803 // Transform API errors to an exception
846 The recommended way to install this library is [through Composer](https://getcomposer.org).
847 [New to Composer?](https://getcomposer.org/doc/00-intro.md)
858 This project aims to run on any platform and thus does not require any PHP
860 It's *highly recommended to use the latest supported PHP version* for this project.