Type alias WatchEffect

WatchEffect: ((get, dispose) => (() => void) | undefined | void)

Create a watch that runs an effect whenever the dependencies change.

Type declaration

    • (get, dispose): (() => void) | undefined | void
    • Parameters

      • get: WatchGet

        The get function which can be used to get the current value of a Val and subscribe to it.

      • dispose: ValDisposer

        The dispose function which can be used to stop the watch.

      Returns (() => void) | undefined | void

Returns

undefined or a function that can be called to clean up the last watch effect.