exome
Version:
State manager for deeply nested states
8 lines (7 loc) • 550 B
TypeScript
import type { Exome } from "./constructor.ts";
type Unsubscribe = () => void;
/**
* Listens to specific actions for all instances of particular store.
*/
export declare const onAction: <T extends Exome, A extends null | "NEW" | "LOAD_STATE" | keyof T>(Parent: new (...args: any[]) => T, action: A, callback: <P extends A extends keyof T ? T[A] extends (...args: infer P_1) => any ? P_1 : any[] : any[]>(instance: T, action: Exclude<A, null>, payload: P, error?: Error, response?: any) => void, type?: "before" | "after") => Unsubscribe;
export {};