Variable: atConcur()
const
atConcur: {<Index
>(index
): <Value
>(concurIterable
) =>ConcurOptional
<Value
>; <Index
,Value
>(index
,concurIterable
):ConcurOptional
<Value
>; }
Defined in: splices.d.ts:844
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.
Call Signature
<
Index
>(index
): <Value
>(concurIterable
) =>ConcurOptional
<Value
>
Type Parameters
Index
Index
extends number
Parameters
index
NonNegativeInteger
<Index
>
Returns
<
Value
>(concurIterable
):ConcurOptional
<Value
>
Type Parameters
Value
Value
Parameters
concurIterable
ConcurIterable
<Value
>
Returns
ConcurOptional
<Value
>
Call Signature
<
Index
,Value
>(index
,concurIterable
):ConcurOptional
<Value
>
Type Parameters
Index
Index
extends number
Value
Value
Parameters
index
NonNegativeInteger
<Index
>
concurIterable
ConcurIterable
<Value
>
Returns
ConcurOptional
<Value
>
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