1.0.1 • Published 4 years ago

weak-value-map v1.0.1

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

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

1.0.1

4 years ago

1.0.0

4 years ago

0.2.0

7 years ago

0.1.0

8 years ago