3.4.4 • Published 4 years ago

@typed/asynciterable v3.4.4

Weekly downloads
1
License
Parity-6.0.0
Repository
github
Last release
4 years ago

@typed/asynciterable

A collection of useful function to work with Async Iterables

API

All type signatures are shown as non-curried for brevity, but all functions are auto-curried.

ap :: <A, B>(fn: AsyncIterable<Arity1<A, B>>, value: AsyncIterable): AsyncIterable

Can be used to apply an AsyncIterable of functions A => B to an AsyncIterable of As. The result is an AsyncIterable of Bs that produces a value first after each has provided at least 1 value, and then every time a value is produced by either.

append :: (value: A, asyncIterable: AsyncIterable): AsyncIterable

Allows adding one extra value just after the AsyncIterable has completed.

chain :: <A, B>(fn: Arity1<A, AsyncIterable>, asyncIterable: AsyncIterable): AsyncIterable

Allows mapping values produced by an AsyncIterable of As to a series of AsyncIterables of Bs.

collect :: (asyncIterable: AsyncIterable): Promise<A[]>

Allows collecting the values produced by an AsyncIterable into a list of values.

concat :: (a: AsyncIterable, b: AsyncIterable): AsyncIterable

Join two AsyncIterables together to produce a new AsyncIterable containing the values of a and when it has finished producing values it will consume the values of b until completion.

contains :: (value: A, asyncIterable: AsyncIterable): Promise

Checks to see if during the production of values if an AsyncIterable produces a particular value. The returned promise will resolve with true as soon as it sees the value and false if the AsyncIterable returns without seeing the given value.

drop :: (amount: number, asyncIterable: AsyncIterable): AsyncIterable

Allows you to skip the first n number of values

filter :: (predicate: Predicate, asyncIterable: AsyncIterable): AsyncIterable

Allows you to skip over values that do not match the given predicate.

forEach :: (fn: (value: A) => void, asyncIterable: AsyncIterable): Promise

Allows performing side-effects with each value produced by an AsyncIterable.

map :: <A, B>(fn: Arity1<A, B>, asyncIterable: AsyncIterable): AsyncIterable

Convert an AsyncIterable of As to an AsyncIterable of Bs by applying the given function of A => B

prepend :: (value: A, asyncIterable: AsyncIterable): AsyncIterable

Prepends a single value to the start of an AsyncIterable.

range :: (from: number, to: number): AsyncIterable

Produces and AsyncIterable of numbers between from and to.

reduce :: <A, B>(reducer: Arity2<B, A, B>, seed: B, asyncIterable: AsyncIterable): Promise

Allows one to accumulate a value over the lifetime of an AsyncIterable.

take :: (amount: number, asyncIterable: AsyncIterable): AsyncIterable

Allows one to listen for a specific number of values from a given AsyncIterable. The underlying AsyncIterable will not be affected if it produces less than the amount specified.

3.4.4

4 years ago

3.4.3

4 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1-alpha.199

5 years ago

0.0.1-alpha.195

5 years ago

0.0.1-alpha.194

5 years ago

0.0.1-alpha.192

5 years ago

0.0.1-alpha.188

5 years ago

0.0.1-alpha.185

5 years ago

0.0.1-alpha.183

5 years ago

0.0.1-alpha.181

5 years ago