Interface CxAccessor

Hierarchy

  • CxAccessor
  • Obtains a value of the given context entry.

    Type Parameters

    • TValue

      Requested context value type.

    Parameters

    • this: void
    • entry: CxEntry<TValue, unknown>

      Context entry to obtain the value of.

    • Optional request: WithoutFallback<TValue>

      Context value request with fallback specified.

    Returns TValue

    Either context entry value, or a fallback one.

  • Obtains a value of the given context entry, or returns a non-nullable fallback.

    Type Parameters

    • TValue

      Requested context value type.

    Parameters

    • this: void
    • entry: CxEntry<TValue, any>

      Context entry to obtain the value of.

    • request: WithFallback<TValue>

      Context value request with fallback specified.

    Returns TValue

    Either context entry value, or a fallback one.

  • Obtains a value of the given context entry, or returns a nullable fallback.

    Throws

    CxReferenceError - If the target entry has no value and fallback one is not provided.

    Type Parameters

    • TValue

      Requested context value type.

    Parameters

    • entry: CxEntry<TValue, any>

      Context entry to obtain the value of.

    • Optional request: CxRequest<TValue>

      Context value request.

    Returns null | TValue

    Either context entry value, or a fallback one.

Generated using TypeDoc