Function: uniqueAsync()
uniqueAsync<
Value
>(asyncIterable
):AsyncIterable
<Value
,any
,any
>
Returns an async iterable containing the values of asyncIterable
in
iteration order, except values are deduplicated if they are equal using
Object.is
.
Type Parameters
• Value
Parameters
• asyncIterable: AsyncIterable
<Value
, any
, any
>
Returns
AsyncIterable
<Value
, any
, any
>
Example
console.log(
await pipe(
asAsync([`sloth`, `not sloth`, `sloth`]),
uniqueAsync,
reduceAsync(toArray()),
),
)
//=> [ 'sloth', 'not sloth' ]