Skip to content

Commit 0c0089e

Browse files
committed
Document passing promises to resolve()/reject() methods of a Defered/Resolver
1 parent 7cf0269 commit 0c0089e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ Resolves a Deferred. All consumers are notified by having their
159159
`$fulfilledHandler` (which they registered via `$promise->then()`) called with
160160
`$result`.
161161

162+
If `$result` itself is a promise, the Deferred will transition to the state of
163+
this promise once it is resolved.
164+
162165
``` php
163166
$resolver->reject(mixed $reason = null);
164167
```
@@ -167,6 +170,9 @@ Rejects a Deferred, signalling that the Deferred's computation failed.
167170
All consumers are notified by having their `$errorHandler` (which they
168171
registered via `$promise->then()`) called with `$reason`.
169172

173+
If `$reason` itself is a promise, the Deferred will be rejected with the outcome
174+
of this promise regardless whether it fulfills or rejects.
175+
170176
``` php
171177
$resolver->progress(mixed $update = null);
172178
```

0 commit comments

Comments
 (0)