@bodil/monkey-business
    Preparing search index...

    Interface WeakMap<K, V>

    Added methods on WeakMaps.

    interface WeakMap<K extends WeakKey, V> {
        getOrInsertComputed(key: K, defaultValue: (key: K) => V): V;
        remove(key: K): Option<V>;
    }

    Type Parameters

    Methods

    • If key exists in the map, return the value associated with it. Otherwise, call defaultValue() to create a new value, insert that into the map under key, and return it.

      Parameters

      • key: K
      • defaultValue: (key: K) => V

      Returns V