react-alien-signals
    Preparing search index...

    Function createComputed

    • Creates a computed Alien Signal based on a getter function. Computed signals are read-only and update automatically when their dependencies change.

      Type Parameters

      • T

        The type of the computed value.

      Parameters

      • fn: (previousValue?: T) => T

        A getter function returning the computed value.

      Returns ReadableSignal<T>

      A computed signal.

      const count = createSignal(1);
      const double = createComputed(() => count() * 2);