@basic-streams/prepend
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@basic-streams/prepend

prepend<T, U>(x: T, stream: Stream<U>): Stream<T | U>

Creates a stream containing values from the given stream and x as the first value.

import ofMany from "@basic-streams/of-many"
import prepend from "@basic-streams/prepend"

const stream = ofMany([1, 2, 3], 5000)

const result = prepend(0, stream)

result(x => {
  console.log(x)
})

// > 0
// > 1
// > 2
// > 3

// stream: ____1____2____3
// result: 0___1____2____3

/@basic-streams/prepend/

    Package Sidebar

    Install

    npm i @basic-streams/prepend

    Weekly Downloads

    6

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.44 kB

    Total Files

    8

    Last publish

    Collaborators

    • pozadi