mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b9afc5647b
commit
891b482abc
22
README.md
22
README.md
@ -1269,27 +1269,41 @@ the `.set(..)` API/logic _and_ active encapsulation of the message API.
|
||||
|
||||
#### `Promise.cooperative()`
|
||||
|
||||
Create a cooperative promise
|
||||
```bnf
|
||||
Promise.cooperative()
|
||||
-> <promise-coop>
|
||||
```
|
||||
|
||||
<!-- XXX -->
|
||||
|
||||
|
||||
#### `<promise-coop>.set(..)`
|
||||
|
||||
Resolve `<promise-coop>` with `<value>`
|
||||
```bnf
|
||||
<promise-coop>.set(<value>)
|
||||
<promise-coop>.set(<value>, true)
|
||||
-> <promise-coop>
|
||||
```
|
||||
|
||||
<!-- XXX -->
|
||||
If `<value>` is a promise, then `<promise-coop>` will be bound to its state, i.e.
|
||||
resolved if `<value>` is resolved and rejected if it is rejected with the same
|
||||
values.
|
||||
|
||||
Reject `<promise-coop>` with `<value>`
|
||||
```bnf
|
||||
<promise-coop>.set(<value>, false)
|
||||
-> <promise-coop>
|
||||
```
|
||||
|
||||
Calling `.set(..)` will set `.isSet` to `true`.
|
||||
|
||||
|
||||
#### `<promise-coop>.isSet`
|
||||
|
||||
<!-- XXX -->
|
||||
Property representing if the cooperative promise was _set_ / `.set(..)` was
|
||||
called (value is `true`) or no (`false`).
|
||||
|
||||
This property is read-only.
|
||||
|
||||
|
||||
#### `<promise-coop>.then(..)`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user