UNPKG

mobx-keystone

Version:

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

33 lines (32 loc) 827 B
/** * A hook action. */ export declare enum HookAction { /** * onInit hook */ OnInit = "$$onInit", /** * onLazyInit hook */ OnLazyInit = "$$onLazyInit", /** * onAttachedToRootStore hook */ OnAttachedToRootStore = "$$onAttachedToRootStore", /** * disposer for onAttachedToRootStore hook */ OnAttachedToRootStoreDisposer = "$$onAttachedToRootStoreDisposer" } /** * Returns if a given action name corresponds to a hook, this is, one of: * - onInit() hook * - onLazyInit() hook * - onAttachedToRootStore() hook * - disposer returned by a onAttachedToRootStore() hook * * @param actionName Action name to check. * @returns true if it is a hook, false otherwise. */ export declare function isHookAction(actionName: string): actionName is HookAction;