effect-io-ai

Package: effect
Module: MutableHashMap

MutableHashMap.empty

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

Signature

declare const empty: <K, V>() => MutableHashMap<K, V>

Source

Since v2.0.0