Function useChange

Hook for managing the execution of an effect based on changes in dependencies.

  • Parameters

    • effect: EffectCallback

      The effect to be executed.

    • Optionaldeps: DependencyList = []

      The dependencies to watch for changes.

    • OptionalstopWatchByDefault: boolean = false

      Whether to initially stop watching for changes.

    Returns {
        beginWatch: (() => void);
        resetWatcher: (() => void);
        stopWatch: (() => void);
    }

    • An object containing utility functions for managing the watcher.
    • beginWatch: (() => void)
        • (): void
        • Returns void

    • resetWatcher: (() => void)
        • (): void
        • Returns void

    • stopWatch: (() => void)
        • (): void
        • Returns void