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

1.0.1 • Public • Published

weak-value-map

A collection of key/value pairs in which the values are weakly referenced.

Install

$ npm install weak-value-map

Usage

Initialization

import WeakValueMap from 'weak-value-map'
 
const map = new WeakValueMap()

Insertion / Deletion

map.set(1, "abcd")
   .set(2, "efg")
   .set(3, "hijk")
 
map.delete(2)

Retrieval

map.get(1)
// => "abcd"
 
map.get(2)
// => undefined
 
map.get(3)
// => "hijk"

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i weak-value-map

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

10.5 kB

Total Files

12

Last publish

Collaborators

  • amapili