map-cached
0.1.3 • Public • Published map-cached
Fully Cached interface for a Promised Map.
var MapCached = require('map-cached');
var MapPromised = require('map-promised');
var MapCached = require('map-cached');
var mapp = new MapPromised(new Map());
var mapc = new MapCached(mapp);
mapp.setup().then(() => {
mapp.set('a', 1);
}).then(() => {
return mapc.setup();
}).then(() => {
mapc.set('b', 2);
mapc.size;
mapc.get('b');
mapc.get('a');
mapc.delete('b');
mapc.size;
mapc.set('c', 3);
mapc.set('d', 4);
mapc.size;
mapc.flush().then(() => {
return mapp.size;
}).then((ans) => ans);
});
Package Sidebar
Install
Weekly Downloads