1.0.3 • Published 8 months ago

@rsf/restream v1.0.3

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

ReStream

Minimal pull-stream library written in Rescript

npm

Installation

npm install @rsf/restream

or

yarn add @rsf/restream

Then add rescript-nodejs to bsconfig.json:

  "bs-dependencies": [
    "@rsf/restream"
  ],

Usage

module S = ReStream

S.fromArray([1, 2, 3, 4])
-> S.map(v => "#" ++ Int.toString(v) )
-> S.collect(res => {
  switch res {
    | Ok(arr) => Console.log(arr)
    | Error(msg) => Console.log(msg)
  }
})
// #1
// #2
// #3
// #4

API

fromArray
fromIterable
fromWebStreamReadable

actionable
observable
abortable

log
tap
take

debounce
throttle
timeout

map
asyncMap
promiseMap
flatMap
asyncFlatMap
paraMap

filter
asyncFilter
filterMap
asyncFilterMap

group
buffer

mix
flatten

combineLatest
zip

drain
abortableDrain
drainToPromise
collect
collectToPromise
toWebStreamReadable

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago