Module-documentation

version 1.0.0
module: LightMap(js-ext) version 0.0.1
size-min gzipped: 1.69 kb (incl. dependencies: kb)
dependencies: polyfill
maintanance: Marco Asbreuk
home


all modules

LightMap

LightMap is a Class-extention of WeakMap with additional methods, but without being weak. It is a light version of ES6's Map.

Getting Started

With nodejs:

Create your project using this package.json. After downloaded, run npm install and start writing your application:

var ITSA = require('itsa');

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>
<script>
    
</script>

The Basics

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:

Example adding items to LightMap

var myLightMap = new ITSA.LightMap(),
    myObj = {},
    data = {};

myLightMap.set(myObj, data);

Features

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:

Summary

each

some

clear

has

get

set

size

delete

API Docs