xstream-pipe
TypeScript icon, indicating that this package has built-in type declarations

11.0.0 • Public • Published
          _                                        _            
         | |                                      (_)           
__  _____| |_ _ __ ___  __ _ _ __ ___ ______ _ __  _ _ __   ___ 
\ \/ / __| __| '__/ _ \/ _` | '_ ` _ \______| '_ \| | '_ \ / _ \
 >  <\__ \ |_| | |  __/ (_| | | | | | |     | |_) | | |_) |  __/
/_/\_\___/\__|_|  \___|\__,_|_| |_| |_|     | .__/|_| .__/ \___|
                                            | |     | |         
                                            |_|     |_|         

Pipeable operators for xstream

Exports core xstream operators as pipeable operators.

Example

import xs from 'xstream'
import { pipe, filter, map, endWhen, take } from 'xstream-pipe';
 
const operator = pipe(
  filter(i => i % 2 === 0),
  map(i => i * i),
  endWhen(xs.periodic(5000).compose(take(1))),
)
 
// or `var stream = operator(xs.periodic(1000))`
var stream = xs.periodic(1000).compose(operator)
 
stream.addListener({
  next: i => console.log(i),
  error: err => console.error(err),
  complete: () => console.log('completed'),
})

Readme

Keywords

none

Package Sidebar

Install

npm i xstream-pipe

Weekly Downloads

1

Version

11.0.0

License

MIT

Unpacked Size

168 kB

Total Files

8

Last publish

Collaborators

  • anilanar