Function: atConcur()
Returns a concur iterable containing the value at the given index
of
concurIterable
in iteration order, or an empty concur iterable if index
is out of bounds.
WARNING: This function linearly iterates up to index
because concur
iterables do not support random access.
Throws
if index
is not a non-negative integer.
Example
const concurIterable = asConcur([`sloth`, `more sloth`, `even more sloth`])
console.log(
await pipe(
concurIterable,
atConcur(1),
getConcur,
),
)
//=> 'more sloth'
Since
v3.5.0
Call Signature
atConcur<
Index
>(index
): <Value
>(concurIterable
) =>ConcurOptional
<Value
>
Type Parameters
• Index extends number
Parameters
index
NonNegativeInteger
<Index
>
Returns
Function
Type Parameters
• Value
Parameters
concurIterable
ConcurIterable
<Value
>
Returns
ConcurOptional
<Value
>
Defined in
Call Signature
atConcur<
Index
,Value
>(index
,concurIterable
):ConcurOptional
<Value
>
Type Parameters
• Index extends number
• Value
Parameters
index
NonNegativeInteger
<Index
>
concurIterable
ConcurIterable
<Value
>
Returns
ConcurOptional
<Value
>