Function useFlatten

  • Accepts a val from anywhere and returns the latest value of the flatten val. Re-rendering is triggered when the derived value changes.

    Type Parameters

    • TValOrValue = any

    Parameters

    Returns UnwrapVal<TValOrValue>

    the value of the flatten val.

  • Accepts a val from anywhere and returns the latest value of the flatten val. Re-rendering is triggered when the derived value changes.

    Type Parameters

    • TValOrValue = any

    Parameters

    Returns undefined | UnwrapVal<TValOrValue>

    the value of the flatten val.

  • Accepts a val from anywhere and returns the latest value of the flatten val. Re-rendering is triggered when the derived value changes.

    Type Parameters

    • TSrcValue = any
    • TValOrValue = any

    Parameters

    Returns UnwrapVal<TValOrValue>

    the value of the flatten val.

  • Accepts a val from anywhere and returns the latest value of the flatten val. Re-rendering is triggered when the derived value changes.

    Type Parameters

    • TSrcValue = any
    • TValOrValue = any

    Parameters

    • val$: undefined | ReadonlyVal<TSrcValue>

      A val of val.

    • get: ((value) => TValOrValue)

      A pure function that gets the inner from val$.

    • Optional eagerOrConfig: boolean | ValConfig<UnwrapVal<TValOrValue>>

      ValConfig of Val or just the eager. Default true.

    Returns undefined | UnwrapVal<TValOrValue>

    the value of the flatten val$, or undefined if val is undefined.