Factory for creating signals

Hierarchy

  • SignalFactory

Methods

  • Combine multiple value updates into one "commit" at the end of the provided callback

    Type Parameters

    • T

    Parameters

    • callback: (() => T)

      callback function that updates multiple signals

        • (): T
        • Returns T

    Returns T

  • Create a new signal that is computed based on the values of other signals.

    Type Parameters

    • T

    Parameters

    • callback: (() => T)

      function to compute the value of the signal

        • (): T
        • Returns T

    Returns ReadonlySignal<T>

  • Run arbitrary code in response to signal changes

    Parameters

    • callback: EffectFunction

      function to invoke when a signal value within the callback changes

    Returns (() => void)

      • (): void
      • Run arbitrary code in response to signal changes

        Returns void

  • Alpha

    Register a component to listen for signal updates. When a signal has been updated the component will re-render

    Parameters

    • component: LimeWebComponent

      the component to register

    • update: ((ref: any) => void)

      function to call to trigger render of the component

        • (ref: any): void
        • Schedules a new render of the given instance or element even if no state changed.

          Notice forceUpdate() is not synchronous and might perform the DOM render in the next frame.

          Parameters

          • ref: any

            the node/element to force the re-render of

          Returns void

    Returns void

  • Create a new signal with the given argument as its initial value

    Type Parameters

    • T

    Parameters

    • Optional value: T

      initial value of the signal

    Returns Signal<T>

  • Run a callback function that can access signal values without subscribing to the signal updates.

    Type Parameters

    • T

    Parameters

    • callback: (() => T)

      callback function

        • (): T
        • Returns T

    Returns T