1.0.0 • Published 7 years ago

@basic-streams/take v1.0.0

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

@basic-streams/take

take<T>(n: number, stream: Stream<T>): Stream<T>

Creates a stream containing only first n events from the source stream.

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

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

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

// > 1
// > 2

// stream: ____1____2!
// result: ____1____2
1.0.0

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.1

7 years ago