Skip to main content

Function: allConcur()

Returns a promise that resolves to true if fn returns a truthy value or a promise that resolves to a truthy value for all values of concurIterable. Otherwise returns a promise that resolves to false.

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

Example

console.log(
await pipe(
asConcur([`sloth`, `more sloth`, `even more sloth`]),
allConcur(string => string.length > 8),
),
)
//=> false

allConcur(fn)

allConcur<Value>(fn): (concurIterable) => Promise<boolean>

Returns a promise that resolves to true if fn returns a truthy value or a promise that resolves to a truthy value for all values of concurIterable. Otherwise returns a promise that resolves to false.

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

Type Parameters

Value

Parameters

fn

Returns

Function

Parameters

concurIterable: ConcurIterable<Value>

Returns

Promise<boolean>

Example

console.log(
await pipe(
asConcur([`sloth`, `more sloth`, `even more sloth`]),
allConcur(string => string.length > 8),
),
)
//=> false

Defined in

predicates.d.ts:95

allConcur(fn, concurIterable)

allConcur<Value>(fn, concurIterable): Promise<boolean>

Returns a promise that resolves to true if fn returns a truthy value or a promise that resolves to a truthy value for all values of concurIterable. Otherwise returns a promise that resolves to false.

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

Type Parameters

Value

Parameters

fn

concurIterable: ConcurIterable<Value>

Returns

Promise<boolean>

Example

console.log(
await pipe(
asConcur([`sloth`, `more sloth`, `even more sloth`]),
allConcur(string => string.length > 8),
),
)
//=> false

Defined in

predicates.d.ts:95