Skip to main content

Function: excludeConcur()

Returns a concur iterable containing the values of concurIterable in iteration order excluding the values of excluded.

Example

import { asConcur, excludeConcur, flatMapConcur, map, pipe, reduceConcur, toArray } from 'lfi'

const API_URL = `https://api.dictionaryapi.dev/api/v2/entries/en`

console.log(
await pipe(
asConcur([`sloth`, `lazy`, `sleep`]),
flatMapConcur(async word => {
const response = await fetch(`${API_URL}/${word}`)
const [{ meanings }] = await response.json()
return map(meaning => meaning.partOfSpeech, meanings)
}),
excludeConcur([`adjective`, `verb`]),
reduceConcur(toArray()),
),
)
//=> [ 'noun', 'noun' ]
Playground

Since

v2.0.0

Call Signature

excludeConcur(excluded): <Value>(concurIterable) => ConcurIterable<Value>

Parameters

excluded

Iterable<unknown, any, any>

Returns

Function

Type Parameters

Value

Parameters

concurIterable

ConcurIterable<Value>

Returns

ConcurIterable<Value>

Defined in

filters.d.ts:401

Call Signature

excludeConcur<Value>(excluded, concurIterable): ConcurIterable<Value>

Type Parameters

Value

Parameters

excluded

Iterable<unknown, any, any>

concurIterable

ConcurIterable<Value>

Returns

ConcurIterable<Value>

Defined in

filters.d.ts:404