[](https://travis-ci.org/mostjs/x-fluent)
npm install @most/fluent
EXPERIMENTAL This is an experimental package.
Use @most/core with a fluent API. @most/fluent wraps a @most/core Stream in a FluentStream type that provides thru and to methods for dot-chaining.
npm i @most/fluent --save
yarn add @most/fluent
``js@most/dom-event
import { change } from @most/core
import { map, filter } from @most/fluent
import { fluently } from
const changes = change(inputElement)
// Wrap a @most/core stream of change events and fluently
// map change events to their associated input value, and
// retain only non-empty values
const changesFluent = fluently(changes)
.thru(map(e => e.target.value))
.thru(filter(value => value.length > 0))
`
A FluentStream is a Stream with two additional methods that enable fluent (dot-chaining) usage.
`js`
type FluentStream = Stream & {
thru (f: (Stream) => Stream): FluentStream
apply (f: (Stream) => B): B
}
Wrap a @most/core Stream in a FluentStream.
#### thru :: FluentStream a ~> (Stream a → Stream b) → FluentStream b
Apply functions fluently to a Stream, wrapping the result in a FluentStream. Use thru when you want to continue dot-chaining other Stream operations.
#### apply :: FluentStream a ~> (Stream a → b) → b
Apply functions fluently to a Stream, _without_ re-wrapping the result. Use apply` to return something other than a Stream.