LightMap is a Class-extention of WeakMap with additional methods, but without being weak. It is a light version of ES6's Map.
With nodejs:
Create your project using this package.json. After downloaded, run npm install
and start writing your application:
In the browser:
For browser-usage, ITSA has a predefined loaderfiles. Once included, a global ITSA
object with default features is available. For customized loaderfiles, read: Customized build.
<script src="/itsabuild-min.js"></script>
LightMap is -like ES6's Map- a map where you can store keys that can be of any type. You create a new LightMap with the new
constructor:
var myLightMap = new ITSA.LightMap();
Once created, you can add, check or delete items just like Map does:
var myLightMap = new ITSA.LightMap(),
myObj = {},
data = {};
myLightMap.set(myObj, data);
A LightMap
doesn't have all ES6's Map features, but the polyfill is light-weight. And it has most of the features needed in most cases: