useCustomEffect

    API

    import useCustomEffect from '@restart/hooks/useCustomEffect'
    • useCustomEffect<TDeps>(effect: EffectCallback, dependencies: TDeps, isEqual: IsEqual<TDeps>) => void

      a useEffect() hook with customized depedency comparision

      Parameters

      • effectEffectCallback

        The effect callback

      • dependenciesTDeps

        A list of dependencies

      • isEqual(nextDeps: TDeps, prevDeps: TDeps) => boolean

        A function comparing the next and previous dependencyLists

      Return Value void

    • useCustomEffect<TDeps>(effect: EffectCallback, dependencies: TDeps, options: CustomEffectOptions<TDeps>) => void

      a useEffect() hook with customized depedency comparision

      Parameters

      • effectEffectCallback

        The effect callback

      • dependenciesTDeps

        A list of dependencies

      • optionsCustomEffectOptions<TDeps>

      Return Value void