Function effect

  • Creates an effect calling the given function once immediately and then again every time a recorded dependency has changed.

    Parameters

    • fn: EffectFunction

      The effect function to run. Can optionally return a cleanup function which is called before effect function is called again and on effect destruction.

    Returns Effect