Function tryResolveValue

  • Tries to resolve a value by the provided token.

    If an argument is an object which has tokens as its properties, then returns an object containing resolved values as properties.

    If a token is not found, then undefined value is used.

    Example

    const value = tryResolveValue(container, tokenA);
    console.log(value); // 1

    const props = tryResolveValue(container, {a: tokenA, b: tokenB});
    console.log(props); // {a: 1, b: 2}

    Type Parameters

    • Tokens extends Token<unknown> | {
          [key: string]: Token<unknown>;
      }

    • Values extends unknown

    Parameters

    Returns Values

Generated using TypeDoc