UNPKG

mobx-keystone-mindreframer

Version:

A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more

16 lines (14 loc) 344 B
/** * @ignore * @internal */ export const modelActionSymbol = Symbol("modelAction") /** * Returns if the given function is a model action or not. * * @param fn Function to check. * @returns */ export function isModelAction(fn: (...args: any[]) => any): boolean { return typeof fn === "function" && !!(fn as any)[modelActionSymbol] }