useCustomEffect
API
import useCustomEffect from '@restart/hooks/useCustomEffect'
useCustomEffect
<TDeps>(effect: EffectCallback, dependencies: TDeps, isEqual: IsEqual<TDeps>) => voida useEffect() hook with customized depedency comparision
Parameters
effect
EffectCallbackThe effect callback
dependencies
TDepsA list of dependencies
isEqual
(nextDeps: TDeps, prevDeps: TDeps) => booleanA function comparing the next and previous dependencyLists
Return Value void
useCustomEffect
<TDeps>(effect: EffectCallback, dependencies: TDeps, options: CustomEffectOptions<TDeps>) => voida useEffect() hook with customized depedency comparision
Parameters
effect
EffectCallbackThe effect callback
dependencies
TDepsA list of dependencies
options
CustomEffectOptions<TDeps>
Return Value void