@hunterkohler/weak-value-map
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

WeakValueMap

Store weakly held references to values in a map with automatic dereferencing. This improves a simple object or map to WeakRef by handling access and existance checks. The api is consistent with the standard Map api. Note that the standard WeakMap holds weak keys, not weak values.

The only difference from the standard Map api is a method WeakValueMap.prototype.clean which searches all entries in the map, deleting those who's values have been destroyed.

Install

Install from npm:

npm install weak-value-map

Documentation

See the documentation here.

Typescript

The project has native type support.

Package Sidebar

Install

npm i @hunterkohler/weak-value-map

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

12 kB

Total Files

7

Last publish

Collaborators

  • hunterkohler