@rxx/worker
Version:
React MVI micro framework.
37 lines (36 loc) • 959 B
TypeScript
import { Observable } from 'rxjs';
export interface SubjectPayload<Type extends string, Payload, States = {}> {
type: Type;
states: States;
payload: Payload;
dispatch(key: string, args: any): void;
}
export declare class SubjectTree {
private subject;
private state;
private preservation;
private shouldImmediateDispatch;
private lastDispatched;
private histories;
private subscribers;
setState(state: any): void;
subscribe(callback: (a: {
type: string;
payload: any;
}) => void): void;
unsubscribe(callback: any): void;
unsubscribeAll(): void;
notify<Payload>(payload: {
type: string;
payload: Payload;
}): void;
readonly observable: Observable<any>;
getLastDispatched(): {
type: string;
payload: any;
} | null;
private notifySubscribers;
private doNotify;
private findHistory;
private createSubjectPayload;
}