• Accepts a val from anywhere and returns the latest value. It only triggers re-rendering when new value emitted from val (base on val $version instead of React's Object.is comparison).

    Type Parameters

    • TValue

    Parameters

    • val$: ReadonlyVal<TValue>

      A val of value

    • Optional eager: boolean

      Trigger subscription callback synchronously. Default true.

    Returns TValue

    the value

  • Accepts a val from anywhere and returns the latest value. It only triggers re-rendering when new value emitted from val (base on val $version instead of React's Object.is comparison).

    Type Parameters

    • TValue = any

    Parameters

    • Optional val$: ReadonlyVal<TValue>

      A val of value

    • Optional eager: boolean

      Trigger subscription callback synchronously. Default true.

    Returns undefined | TValue

    the value, or undefined if val is undefined

  • Returns the value if it is not a val.

    Type Parameters

    • TValue

    Parameters

    • value: TValue

      A non-val value

    • Optional eager: boolean

      Trigger subscription callback synchronously. Default true.

    Returns UnwrapVal<TValue>

    the value

  • Returns the value if it is not a val.

    Type Parameters

    • TValue

    Parameters

    • Optional value: TValue

      A non-val value

    • Optional eager: boolean

      Trigger subscription callback synchronously. Default true.

    Returns undefined | UnwrapVal<TValue>

    the value