Function tryResolveValues

  • Returns an array of resolved values or objects with resolved values.

    If an item of the array 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 items1 = tryResolveValues(container, tokenA);
    console.log(items1); // [1]

    const items2 = tryResolveValues(container, tokenA, {a: tokenA, b: tokenB});
    console.log(items2); // [1, {a: 1, b: 2}]

    Type Parameters

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

    • Values extends { [ K in string | number | symbol]: Tokens[K] extends Token<V> ? undefined | V : Tokens[K] extends TokenProps<Props> ? Partial<Props> : never }

    Parameters

    Returns Values

Generated using TypeDoc