mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
11d6aff037
commit
f5f2ec4e11
@ -1243,14 +1243,14 @@ See [`<promise-iter>.then(..)`](#promise-iterthen--promise-itercatch--promise-it
|
||||
|
||||
A _cooperative promise_ is one that can be finalized externally/cooperatively.
|
||||
|
||||
This can be useful when breaking recursive dependencies between promises or when
|
||||
This can be useful for breaking recursive dependencies between promises or when
|
||||
it is simpler to thread the result receiver promise down the stack than building
|
||||
a promise stack and manually threading the result up.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
// NOTE: implementing this via Promise.any(..) would also require implementing a
|
||||
// way to stop the "workers" that did not succeed to get the result first...
|
||||
// way to stop the "workers" after the result is found...
|
||||
async function controller(trigger){
|
||||
while(!trigger.isSet)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user