hookSetup
hookSetup<
K
>(key
:K
): <T
>(…config
:Parameters
<Adapters
<Parameters
<MethodOf
<T
,K
>>[0
]>[K
]>) => (target
:T
) =>DisposeFunc
Defined in: state-machine-hooks.ts:17
Creates a lifecycle hook enhancer for a given StateMachine method key. Returns a function that applies the hook and provides a disposer to remove it.
Usage:
hookSetup("before")(config)(machine)
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
K extends string |
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
key | K |
Returns
Section titled “Returns”<
T
>(…config
:Parameters
<Adapters
<Parameters
<MethodOf
<T
,K
>>[0
]>[K
]>): (target
:T
) =>DisposeFunc
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
T extends HasMethod <K > |
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
…config | Parameters <Adapters <Parameters <MethodOf <T , K >>[0 ]>[K ]> |
Returns
Section titled “Returns”(
target
:T
):DisposeFunc
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
target | T |