@fluent-windows/hooks
Version:
Fluent-Windows React hooks.
12 lines (11 loc) • 490 B
TypeScript
export declare type Type = string | object;
export declare type Callback = (payload: any) => any;
export declare type Deps = (string | number | null | undefined | boolean)[] | [];
export declare type Payload = any;
export interface Dispatch {
type: Type;
payload?: Payload;
}
export declare function subscribe(type: Type, callback: Callback): void;
export declare function unsubscribe(type: Type, callback: Callback): void;
export declare function dispatch(param?: Dispatch): void;