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

0.0.5 • Public • Published

Build status

npm install litestream

Simple stream for simple purposes

import {Stream} from "../src";

let stream = new Stream()

stream.when((t)=>t=="Hello ").subscribe((text:string)=>{
    console.log(text + "world");
});

stream.notify("Hello ");
stream.notify("Hi ");
//console: Hello world
import {Stream} from "../src";

let stream = new Stream();

let wow = (new Stream()).when((t)=>t=="wow").subscribe((t)=>console.log(`WOW!!`));
let yep = (new Stream()).when((t)=>t=="yep").subscribe((t)=>console.log(`Yep is yep`));

stream.pipe(wow).pipe(yep);

stream.notify("yep");
stream.notify("wow");

//console : Yep is yep
//console : WOW!!

Operators

when(predicate) unique(pridicate) mapTo(predicate)

Readme

Keywords

none

Package Sidebar

Install

npm i litestream

Weekly Downloads

106

Version

0.0.5

License

ISC

Unpacked Size

20 kB

Total Files

18

Last publish

Collaborators

  • pavel.shirobok