UNPKG

impair

Version:

impair is a React framework bringing several programming concepts together in order to provide a foundation for a layered, scalable, performant and enterprise level react application.

15 lines (14 loc) 648 B
import { TriggerCleanup } from '../types'; /** * This decorator is used to mark a method as an onMount method. * It will automatically create a mount function that will be called when the containing ServiceProvider or Component is mounted * The method can also accept an optional Cleanup function which will be called when containing ServiceProvider or Component is unmounted. *```ts * \@onMount * public mount(cleanup: Cleanup) { * // do something * } * ``` */ export declare function onMount(target: any, propertyKey: string): void; export declare function getOnMountMethods(instance: any): ((cleanup: TriggerCleanup) => void)[];