• Registers the given function to track reactive updates.

    The given function will be run once immediately. Every time any reactive property that's accessed within it gets updated, the function will run again.

    Type Parameters

    • T = any

    Parameters

    • fn: (() => T)

      The function that will track reactive updates.

        • (): T
        • Returns T

    • Optionaloptions: ReactiveEffectOptions

      Allows to control the effect's behaviour.

    Returns ReactiveEffectRunner

    A runner that can be used to control the effect after creation.