Function: takeConcur()
Returns a concur iterable containing the first count
values of
concurIterable
in iteration order.
If the count
is greater than the number of values in concurIterable
, then
a concur iterable equivalent concurIterable
is returned.
Throws
if count
isn't a non-negative integer.
Example
console.log(
await pipe(
asConcur([1, 2, 3, 4, 5, `sloth`]),
takeConcur(3),
reduceConcur(toArray()),
),
)
//=> [ 1, 2, 3 ]
takeConcur(count)
takeConcur<
Count
>(count
): <Value
>(concurIterable
) =>ConcurIterable
<Value
>
Returns a concur iterable containing the first count
values of
concurIterable
in iteration order.
If the count
is greater than the number of values in concurIterable
, then
a concur iterable equivalent concurIterable
is returned.
Type Parameters
• Count extends number
Parameters
• count: NonNegativeInteger
<Count
>
Returns
Function
Type Parameters
• Value
Parameters
• concurIterable: ConcurIterable
<Value
>
Returns
ConcurIterable
<Value
>
Throws
if count
isn't a non-negative integer.
Example
console.log(
await pipe(
asConcur([1, 2, 3, 4, 5, `sloth`]),
takeConcur(3),
reduceConcur(toArray()),
),
)
//=> [ 1, 2, 3 ]
Defined in
takeConcur(count, concurIterable)
takeConcur<
Count
,Value
>(count
,concurIterable
):ConcurIterable
<Value
>
Returns a concur iterable containing the first count
values of
concurIterable
in iteration order.
If the count
is greater than the number of values in concurIterable
, then
a concur iterable equivalent concurIterable
is returned.
Type Parameters
• Count extends number
• Value
Parameters
• count: NonNegativeInteger
<Count
>
• concurIterable: ConcurIterable
<Value
>
Returns
ConcurIterable
<Value
>
Throws
if count
isn't a non-negative integer.
Example
console.log(
await pipe(
asConcur([1, 2, 3, 4, 5, `sloth`]),
takeConcur(3),
reduceConcur(toArray()),
),
)
//=> [ 1, 2, 3 ]