1.1.0 • Published 7 years ago

@typed/stream v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

@typed/stream

Well-typed extensions to @most/core

Get it

yarn add @typed/stream
# or
npm install --save @typed/stream

API

filterMaybe\<A>(maybe$: Stream\<Maybe\<A>>): Stream\<A>

Filters out the Nothing values a stream of Maybes and unwraps the values of all Justs.

maybe$:             ---N---J(1)---N---J(1)---->
filterMaybe(maybe$):---------1----------1----->

splitEither\<A, B>(either$: Stream\<Either\<A, B>>): Stream\<A>, Stream\<B>

Splits the values contained in an Either and produces 1 stream for the Left and 1 stream Right values.

either$: ---L(1)---R(2)---L(3)---R(4)--->
const [ left$, right$ ] = splitEither(either$)
left$:   -----1-------------3----------->
right$:  ------------2-------------4---->