Skip to main content

Function: filterConcur()

Returns a concur iterable that contains the values of concurIterable excluding the values for which fn returns a value awaitable to a falsy value.

Like Array.prototype.filter, but for concur iterables.

Example

console.log(
await pipe(
asConcur([`sloth party`, `building`, `sloths in trees`, `city`]),
filterConcur(string => string.includes(`sloth`)),
reduceConcur(toArray()),
),
)
//=> [ 'sloth party', 'sloths in trees' ]

filterConcur(fn)

filterConcur<From, To>(fn): (concurIterable) => ConcurIterable<To>

Returns a concur iterable that contains the values of concurIterable excluding the values for which fn returns a value awaitable to a falsy value.

Like Array.prototype.filter, but for concur iterables.

Type Parameters

From

To

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<From>

Returns

ConcurIterable<To>

Example

console.log(
await pipe(
asConcur([`sloth party`, `building`, `sloths in trees`, `city`]),
filterConcur(string => string.includes(`sloth`)),
reduceConcur(toArray()),
),
)
//=> [ 'sloth party', 'sloths in trees' ]

Defined in

filters.d.ts:104

filterConcur(fn, concurIterable)

filterConcur<From, To>(fn, concurIterable): ConcurIterable<To>

Returns a concur iterable that contains the values of concurIterable excluding the values for which fn returns a value awaitable to a falsy value.

Like Array.prototype.filter, but for concur iterables.

Type Parameters

From

To

Parameters

fn

concurIterable: ConcurIterable<From>

Returns

ConcurIterable<To>

Example

console.log(
await pipe(
asConcur([`sloth party`, `building`, `sloths in trees`, `city`]),
filterConcur(string => string.includes(`sloth`)),
reduceConcur(toArray()),
),
)
//=> [ 'sloth party', 'sloths in trees' ]

Defined in

filters.d.ts:107

filterConcur(fn)

filterConcur<Value>(fn): (concurIterable) => ConcurIterable<Value>

Returns a concur iterable that contains the values of concurIterable excluding the values for which fn returns a value awaitable to a falsy value.

Like Array.prototype.filter, but for concur iterables.

Type Parameters

Value

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

console.log(
await pipe(
asConcur([`sloth party`, `building`, `sloths in trees`, `city`]),
filterConcur(string => string.includes(`sloth`)),
reduceConcur(toArray()),
),
)
//=> [ 'sloth party', 'sloths in trees' ]

Defined in

filters.d.ts:112

filterConcur(fn, concurIterable)

filterConcur<Value>(fn, concurIterable): ConcurIterable<Value>

Returns a concur iterable that contains the values of concurIterable excluding the values for which fn returns a value awaitable to a falsy value.

Like Array.prototype.filter, but for concur iterables.

Type Parameters

Value

Parameters

fn

concurIterable: ConcurIterable<Value>

Returns

ConcurIterable<Value>

Example

console.log(
await pipe(
asConcur([`sloth party`, `building`, `sloths in trees`, `city`]),
filterConcur(string => string.includes(`sloth`)),
reduceConcur(toArray()),
),
)
//=> [ 'sloth party', 'sloths in trees' ]

Defined in

filters.d.ts:115