gradum-kit - v0.1.0
    Preparing search index...

    Function untrack

    • Function

      untrack

      Type Parameters

      • T

        The type returned by the callback.

      Parameters

      • fn: () => T

        The callback to run outside the tracking context.

      Returns T

      Whatever the callback returns.

      Read signals without subscribing to them. Signals read inside the callback are not recorded as dependencies of the surrounding @effect, so changing them later will not re-run it. Use it when an effect needs a value to compute with but should not fire when that value changes — reading a current index or a configuration flag, say, while only tracking the data being rendered.

      @effect private render() {
      // re-runs when `items` changes, but not when `verbose` does
      this.draw(this.model.items, untrack(() => this.model.verbose));
      }