@10kb/stream 中文文档教程
Install
npm install 10kb/stream
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) 独特的(私有的) 映射到(谓词)
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)
更多
你可能也喜欢
- 3vot-model 中文文档教程
- @10play/phoenix 中文文档教程
- @131/sqlite3 中文文档教程
- @1o1w1/eslint-config-react-app 中文文档教程
- @1productaweek/react-virtualized-grid 中文文档教程
- @abhishek09091/abhishek0909-test 中文文档教程
- @abi-software/mapcore-augmented-results 中文文档教程
- @aboulmagd/gis 中文文档教程
- @acmecorp/content 中文文档教程
- @adactiveasia/adasia-modal 中文文档教程