Mirror: 馃帺 A tiny but capable push & pull stream library for TypeScript and Flow
at v3.0.0 525 B view raw
1export type List<T> = [T, any] | 0; 2 3export type Talkback = 0 | 1; 4 5export type Signal<A> = 6 | ({ tag: 0 } & [(talkback: Talkback) => void]) 7 | ({ tag: 1 } & [A]) 8 | 0; 9 10export interface Sink<A> { (signal: Signal<A>): void; } 11export interface Source<A> { (sink: Sink<A>): void; } 12export interface Operator<A, B> { (source: Source<A>): Source<B>; } 13 14export type Subscription = [() => void]; 15 16export type Observer<A> = [(value: A) => void, () => void]; 17 18export type Subject<A> = [Source<A>, (value: A) => void, () => void];