GitXplorerGitXplorer
d

weak-value-map

public
8 stars
1 forks
1 issues

Commits

List of commits on branch master.
Verified
8b2062860e798d31f6328d5f55181ab09ca1c33b

updates

ddevsnek committed 5 years ago
Verified
23453751dc7b381ec9052368abd1728ed871a46e

upload MIT license

ddevsnek committed 5 years ago
Verified
b761620c4540d5040bcb782023513b4e6f70e767

first commit

ddevsnek committed 5 years ago

README

The README file for this repository.

WeakValueMap

A map where the values are weak.

import WeakValueMap from '@snek/wvm';

const map = new WeakValueMap();
map.set('some key', someBigObject);

new WeakValueMap([iterable [, options]])

  • iterable An Array or other iterable object whose elements are key-value pairs (arrays with two elements, e.g. [[ 1, { a: 1 } ], [ 2, { a: 2 } ]]). Each key-value pair is added to the new Map; null values are treated as undefined.
  • options
    • eager A boolean option indicating whether collected items should be eagerly tracked and removed from the map. If you have concerns about GC pressure, you may want to consider disabling this option. Default: true.