Most Proxy
Create circular stream dependencies that is declarative and designed to avoid memory leaks.
This codebase is proudly written in TypeScript so you can enjoy beautiful typings.
Install
npm install --save most-proxy
Example
// create a proxy// returns *attach* to attach proxy to another stream, and a proxy stream *stream*const attach stream = // observe the proxy, taking only three events// proxy is a real most.Stream// when stream ends, original will also be disposed of internallystream // 1, 2, 3 // here we create the stream we want to use as the circular dependencyconst original = // pipe events from original to proxy stream
API Documentation
interface Proxy<T> { attach(stream: Stream<T>): Stream<T>; stream: Stream<T>;}