mirror of
https://github.com/AmberGraceRblx/luau-promise.git
synced 2025-04-24 23:50:03 +00:00
update documentation
This commit is contained in:
parent
4fc7792c0c
commit
9d554f236a
1 changed files with 50 additions and 27 deletions
|
@ -356,6 +356,29 @@ docs:
|
||||||
returns: Promise<number>
|
returns: Promise<number>
|
||||||
static: true
|
static: true
|
||||||
|
|
||||||
|
- name: fold
|
||||||
|
since: unreleased
|
||||||
|
desc: |
|
||||||
|
Folds an array into a promise or a value. The array is traversed sequentially and
|
||||||
|
|
||||||
|
The reducer function can return a promise or directly a value. It always received the last resolved value.
|
||||||
|
|
||||||
|
The folding will stop at the first rejection encountered.
|
||||||
|
```
|
||||||
|
params:
|
||||||
|
- name: list
|
||||||
|
type: "array<T>"
|
||||||
|
- name: reducer
|
||||||
|
desc: The function to call with the accumulated value, the current element from the array and its index.
|
||||||
|
type:
|
||||||
|
kind: function
|
||||||
|
params: "accumulator: U, value: T, index: number"
|
||||||
|
returns: U | Promise<U>
|
||||||
|
- name: initialValue
|
||||||
|
type: "U"
|
||||||
|
returns: U | Promise<U>
|
||||||
|
static: true
|
||||||
|
|
||||||
- name: each
|
- name: each
|
||||||
since: 3.0.0
|
since: 3.0.0
|
||||||
desc: |
|
desc: |
|
||||||
|
|
Loading…
Reference in a new issue