UNPKG

@excentone/spfx-react

Version:

Contains custom ReactJs components and hooks intended to use when developing SharePoint Framework (SPFx) Web components.

8 lines (7 loc) 580 B
import { Func } from "@excentone/spfx-utilities"; /** * `useSafeDispatch` wraps the specified {@link dispatch} method to safely dispatch while the React component is mounted. * @param dispatch The dispatch method to invoke if the React component is still mounted. * @returns A function that conditionally executes the dispatch method. */ export declare const useSafeDispatch: <TReturn = void, T0 = never, T1 = never, T2 = never, T3 = never, T4 = never, T5 = never, T6 = never>(dispatch: Func<TReturn, T0, T1, T2, T3, T4, T5, T6>) => Func<TReturn, T0, T1, T2, T3, T4, T5, T6>;