Const
The map containing values.
The key to use when retrieving a value.
The creator function or value to use when the key does not already exist in the map.
Optional
retrieveAction: (value: Exclude<ReturnType<TMap["get"]>, undefined>) => voidAn optional action to perform on the value when it already exists in the map.
Get a
TValue
from themap
, and add it first if it doesn't already exist in the map.