gameplate - v2.3.0
    Preparing search index...

    Function createSelector

    • Overload 1: a single input selector.

      The combiner receives the selector's return value and produces a derived result. Memoized: while the input's return value is Object.is-equal to the previous one, the combiner is not re-run.

      Type Parameters

      • F extends AnyStateSelector
      • R

      Parameters

      • input: F
      • combiner: (value: ResultOf<F>) => R

      Returns Selector<StateOf<F>, R>

    • Overload 2: an array of input selectors.

      The combiner receives each input's return value as positional args. The combiner is re-run when any input's reference changes.

      Type Parameters

      • T extends readonly AnyStateSelector[]
      • R

      Parameters

      • inputs: T
      • combiner: (...values: TupleResults<T>) => R

      Returns Selector<StateOf<T[number]>, R>