New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@basic-streams/prepend

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@basic-streams/prepend

prepend operator for basic-streams

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

@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

Keywords

basic-streams

FAQs

Package last updated on 09 Jul 2018

Related posts