-
Notifications
You must be signed in to change notification settings - Fork 16
/
p-locate.node.txt
18 lines (13 loc) · 1.71 KB
/
p-locate.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
P-LOCATE
VERSION ==> #6.0.0
P-LOCATE([PROMISE_]VAL_ITERABLE, #Like ARR.find() but async.
FUNC(VAL)->[PROMISE_]BOOL #Resolves to undefined if none found
[, OPTS])->PROMISE[_VAL] #Rejects if any PROMISE rejects
#OPTS:
# - concurrency NUM (def: Infinity)
# - preserveOrder BOOL:
# - if true (def), returns the first one according to VAL_ITERABLE order
# - i.e. when one is found but previous VALs haven't resolved yet, wait for them
# - i.e. slower