Lines Matching refs:a

61 Promise is a library implementing
75 A **Deferred** represents a computation or unit of work that may not have
81 While a deferred represents the computation itself, a **Promise** represents
82 the result of that computation. Thus, each deferred has a promise that acts as
83 a placeholder for its actual result.
131 If `$value` itself is a promise, the promise will transition to the state of
145 If `$reason` itself is a promise, the promise will be rejected with the outcome
170 Once in the fulfilled or rejected state, a promise becomes immutable.
186 Transforms a promise's value by applying a function to the promise's fulfillment
187 or rejection value. Returns a new promise for the transformed result.
190 with a promise (all parameters are optional):
197 triggers progress notifications and passed a single argument (whatever it
200 It returns a new promise that will fulfill with the return value of either
215 * [resolve()](#resolve) - Creating a resolved promise
216 * [reject()](#reject) - Creating a rejected promise
241 It will cause a fatal error if either `$onFulfilled` or `$onRejected` throw or
242 return a rejected promise.
258 Registers a rejection handler for promise. It is a shortcut for:
284 Allows you to execute "cleanup" type tasks in a promise chain.
291 * If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a
296 * If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a
316 Similar asynchronous code (with `doSomething()` that returns a promise) can be
333 Registers a handler for progress updates from promise. It is a shortcut for:
341 A cancellable promise provides a mechanism for consumers to notify the creator
354 Once a promise is settled (either fulfilled or rejected), calling `cancel()` on
355 a promise has no effect.
366 Creates a promise whose state is controlled by the functions passed to
392 The promise constructor receives a resolver function and an optional canceller
396 returned promise. Accepts either a non-promise value, or another promise.
397 When called with a non-promise value, fulfills promise with that value.
414 Creates a already fulfilled promise.
420 Note, that `$value` **cannot** be a promise. It's recommended to use
427 Creates a already rejected promise.
433 Note, that `$reason` **cannot** be a promise. It's recommended to use
440 Creates a promise which will be lazily initialized by `$factory` once a consumer
467 is a promise which resolves to an array, this promise is also cancelled.
475 Creates a promise for the supplied `$promiseOrValue`.
477 If `$promiseOrValue` is a value, it will be the resolution value of the
480 If `$promiseOrValue` is a thenable (any object that provides a `then()` method),
481 a trusted promise that follows the state of the thenable is returned.
483 If `$promiseOrValue` is a promise, it will be returned as is.
485 Note: The promise returned is always a promise implementing
486 [ExtendedPromiseInterface](#extendedpromiseinterface). If you pass in a custom
488 promise will be assimilated to a extended promise following `$promiseOrValue`.
496 Creates a rejected promise for the supplied `$promiseOrValue`.
498 If `$promiseOrValue` is a value, it will be the rejection value of the
501 If `$promiseOrValue` is a promise, its completion value will be the rejected
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
514 Returns a promise that will resolve only once all the items in
525 Initiates a competitive race that allows one winner. Returns a promise which is
534 Returns a promise that will resolve when any one of the items in
541 The returned promise will also reject with a `React\Promise\Exception\LengthException`
550 Returns a promise that will resolve when `$howMany` of the supplied items in
560 The returned promise will also reject with a `React\Promise\Exception\LengthException`
570 promises and/or values, and `$mapFunc` may return either a value or a promise.
572 The map function receives each item as argument, where item is a fully resolved
573 value of a promise or value in `$promisesOrValues`.
582 promises and/or values, and `$reduceFunc` may return either a value or a
583 promise, *and* `$initialValue` may be a promise or a value for the starting
588 The `React\Promise\PromisorInterface` provides a common interface for objects
589 that provide a promise. `React\Promise\Deferred` implements it, but since it
602 // Execute a Node.js-style function using the callback pattern
642 Each call to `then()` returns a new promise that will resolve with the return
643 value of the previous handler. This creates a promise "pipeline".
651 // and returns a *new promise* for $x + 1
681 Similarly, when you handle a rejected promise, to propagate the rejection,
682 "rethrow" it by either returning a rejected promise, or actually throwing
712 rejections will still forward handler results in a predictable way.
726 // This is like catch without a rethrow
741 **MUST** return a progress event to be propagated to the next link in the chain.
744 Also in the same way as resolutions and rejections, if you don't register a
754 registering a progress handler.
776 At a first glance, `then()` and `done()` seem very similar. However, there are
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
785 In addition to transforming a value, `then()` allows you to recover from, or
790 error (either a thrown exception or returned rejection) escapes the
792 rethrown in an uncatchable way causing a fatal error.
821 // Here we provide a rejection handler which will either throw while debugging
838 Note that if a rejection value is not an instance of `\Exception`, it will be
865 Promise is a port of [when.js](https://github.com/cujojs/when)