Package: effect
Module: MutableHashMap
Creates an empty MutableHashMap.
When to use
Use to create a fresh mutable map before adding entries over time.
Details
Each call returns a new empty map instance.
Example (Creating an empty map)
import { MutableHashMap } from "effect"
const map = MutableHashMap.empty<string, number>()
// Add some entries
MutableHashMap.set(map, "key1", 42)
MutableHashMap.set(map, "key2", 100)
console.log(MutableHashMap.size(map)) // 2
See
make for creating a map from explicit entriesfromIterable for creating a map from an iterable of entriesSignature
declare const empty: <K, V>() => MutableHashMap<K, V>
Since v2.0.0