Skip to main content Link Search Menu Expand Document (external link)

MutableHashMap overview

Added in v1.0.0


Table of contents


constructors

empty

Signature

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

Added in v1.0.0

make

Signature

export declare const make: <Entries extends (readonly [any, any])[]>(
  ...entries: Entries
) => MutableHashMap<
  Entries[number] extends readonly [infer K, any] ? K : never,
  Entries[number] extends readonly [any, infer V] ? V : never
>

Added in v1.0.0

conversions

fromIterable

Signature

export declare const fromIterable: <K, V>(entries: Iterable<readonly [K, V]>) => MutableHashMap<K, V>

Added in v1.0.0

elements

get

Signature

export declare const get: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => Option.Option<V>
  <K, V>(self: MutableHashMap<K, V>, key: K): Option.Option<V>
}

Added in v1.0.0

has

Signature

export declare const has: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => boolean
  <K, V>(self: MutableHashMap<K, V>, key: K): boolean
}

Added in v1.0.0

size

Signature

export declare const size: <K, V>(self: MutableHashMap<K, V>) => number

Added in v1.0.0

models

MutableHashMap (interface)

Signature

export interface MutableHashMap<K, V> extends Iterable<readonly [K, V]>, Pipeable, Inspectable {
  readonly [TypeId]: TypeId

  /** @internal */
  readonly backingMap: MutableRef.MutableRef<HashMap.HashMap<K, V>>
}

Added in v1.0.0

symbol

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0

utils

modify

Updates the value of the specified key within the MutableHashMap if it exists.

Signature

export declare const modify: {
  <K, V>(key: K, f: (v: V) => V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, f: (v: V) => V): MutableHashMap<K, V>
}

Added in v1.0.0

modifyAt

Set or remove the specified key in the MutableHashMap using the specified update function.

Signature

export declare const modifyAt: {
  <K, V>(key: K, f: (value: Option.Option<V>) => Option.Option<V>): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, f: (value: Option.Option<V>) => Option.Option<V>): MutableHashMap<K, V>
}

Added in v1.0.0

remove

Signature

export declare const remove: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K): MutableHashMap<K, V>
}

Added in v1.0.0

set

Signature

export declare const set: {
  <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>
}

Added in v1.0.0