0.2.1 • Published 4 years ago

@10kb/stream v0.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Build status

Install

npm install 10kb/stream

Purposes

Simple stream for simple purposes

Motivation

TODO

Examples

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)

0.2.1

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago