Markupless Documentation - v0.4.3
    Preparing search index...

    Function effect

    • Registers a side effect that runs immediately and re-runs whenever any state accessed within it changes.

      Parameters

      • fn: () => void

        The function to execute.

      Returns void

      const name = state("World");
      effect(() => {
      document.body.innerText = `Hello ${name.value}`;
      });