@arcmantle/adapter-element
    Preparing search index...

    Function effect

    • Create an effect to run arbitrary code in response to signal changes.

      An effect tracks which signals are accessed within the given callback function fn, and re-runs the callback when those signals change.

      The callback may return a cleanup function. The cleanup function gets run once, either when the callback is next called or when the effect gets disposed, whichever happens first.

      Parameters

      • fn: EffectFn

        The effect callback.

      Returns { "[dispose]"(): void; (): void }

      A function for disposing the effect.