Package: effect
Module: MutableHashMap
Returns an iterable over the keys in the MutableHashMap.
When to use
Use to iterate over the keys currently stored in a mutable hash map.
Example (Reading keys)
import { MutableHashMap } from "effect"
const map = MutableHashMap.make(
["apple", 1],
["banana", 2],
["cherry", 3]
)
const allKeys = Array.from(MutableHashMap.keys(map))
console.log(allKeys) // ["apple", "banana", "cherry"]
// Useful for iteration or validation
const hasRequiredKeys = allKeys.includes("apple") && allKeys.includes("banana")
See
values for iterating over stored valueshas for checking one key without iteratingSignature
declare const keys: <K, V>(self: MutableHashMap<K, V>) => Iterable<K>
Since v3.8.0