atombeak
Version:
Create asynchronous atomic functions!
21 lines (20 loc) • 639 B
TypeScript
export declare const READ: 'READ';
export declare type LogItem<Outer, Inner, Action> = ReadLogItem<Outer, Inner> | WriteLogItem<Inner, Action> | StateLogItem<Outer>;
export declare type ReadLogItem<Outer, Inner> = Readonly<{
type: typeof READ;
id: string;
reader: (outer: Outer) => Inner;
value: Inner;
}>;
export declare const WRITE: 'WRITE';
export declare type WriteLogItem<Inner, Action> = Readonly<{
type: typeof WRITE;
id: string;
value: Inner;
action: Action;
}>;
export declare const STATE: 'STATE';
export declare type StateLogItem<Outer> = Readonly<{
type: typeof STATE;
outer: Outer;
}>;