Install via NPM.
npm install iterable-weak-collections
This library adds IterableWeakSet
and IterableWeakMap
. They implement the built-in Set
and Map
interfaces.
import { IterableWeakMap, IterableWeakSet } from "iterable-weak-collections";
const map = new IterableWeakMap();
const set = new IterableWeakSet();
class IterableWeakMap<K extends Object, T> implements Map<K,T> {
}
class IterableWeakSet<K extends Object, T> implements Set<K,T> {
}
This library is implemented using WeakRef
, which is supported in Node and most major browsers.
- Sub-pub
- Code diagnostics and monitoring
MIT License
All files can be used for commercial or non-commercial purposes. Do not resell. Attribution is appreciated but not due.