Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

@thi.ng/rstream-csp

2.0.2 • Public • Published

@thi.ng/rstream-csp

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

Adapter bridge between async CSP channels and synchronous stream subscriptions/transformations of @thi.ng/rstream.

Status

STABLE - used in production

Related packages

  • @thi.ng/csp - ES6 promise based CSP primitives & operations
  • @thi.ng/rstream - Reactive streams & subscription primitives for constructing dataflow graphs / pipelines

Installation

yarn add @thi.ng/rstream-csp

Package sizes (gzipped): ESM: 0.2KB / CJS: 0.3KB / UMD: 0.4KB

Dependencies

API

Generated API docs

import * as rs from "@thi.ng/rstream";
import * as tx from "@thi.ng/transducers";
import { fromChannel } from "@thi.ng/rstream-csp";
import { Channel } from "@thi.ng/csp";
 
ch = new Channel();
stream = fromChannel(ch);
 
stream.subscribe(rs.trace("all"));
stream.subscribe(rs.trace("only evens"), tx.filter(tx.even));
 
ch.write(1);
// all 1
 
ch.write(2);
// all 2
// only evens 2
 
stream.subscribe(rs.trace("tentimes"), tx.map(x => x * 10));
// all 3
// tentimes 30

Authors

Karsten Schmidt

License

© 2018 - 2020 Karsten Schmidt // Apache Software License 2.0

Install

npm i @thi.ng/rstream-csp

DownloadsWeekly Downloads

187

Version

2.0.2

License

Apache-2.0

Unpacked Size

28 kB

Total Files

13

Last publish

Collaborators

  • avatar