Preparing search index...
    • Adds a value to a multimap (Map with Array values)

      Creates a new array for the key if it doesn't exist, or adds the value to the existing array if the value isn't already present.

      Type Parameters

      • TKey
      • TValue

      Parameters

      • multimap: Map<TKey, TValue[]>

        The multimap to modify

      • key: TKey

        The key to add the value under

      • value: TValue

        The value to add

      Returns void

      const filters = new Map();
      addValueToMultimap(filters, listFilter.tags, "Dessert");
      addValueToMultimap(filters, listFilter.tags, "Quick");