useTreeEventsHandler Function

Custom hook which creates and takes care of disposing a TreeEventsHandler. The input is either a factory method

for a custom TreeEventHandler implementation or parameters for the default implementation.

useTreeEventsHandler<TEventsHandler extends TreeEventHandler<TEventsHandler>>(factoryOrParams: TreeEventHandlerParams | () => TEventsHandler): TreeEventHandler

note Caller must ensure factoryOrParams changes only when a new handler needs to be created. useCallback or useMemo can be used for that purpose based on whether the input is a factory function or params object.

Parameter Type Description
factoryOrParams TreeEventHandlerParams | () => TEventsHandler  

Returns - TreeEventHandler

Defined in

Last Updated: 20 June, 2023