mobx-keystone
Version:
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
17 lines (16 loc) • 812 B
TypeScript
/**
* Creates a standalone action. A standalone action must always take an existing tree node as first argument.
*
* @param actionName Unique action name.
* @param fn Function.
* @returns The function as an standalone action.
*/
export declare function standaloneAction<FN extends (target: any, ...args: any[]) => any>(actionName: string, fn: FN): FN;
/**
* Creates a standalone flow. A standalone flow must always take an existing tree node as first argument.
*
* @param actionName Unique action name.
* @param fn Function.
* @returns The function as an standalone flow.
*/
export declare function standaloneFlow<TTarget, TArgs extends any[], TResult>(actionName: string, fn: (target: TTarget, ...args: TArgs) => Generator<any, TResult, any>): (target: TTarget, ...args: TArgs) => Promise<TResult>;