Inheritable version of the Immutable.Map data type
npm install inheritable-map
Inheritable version of the Immutable.Map data type
are(you(tired(of(counting(parenthesis)))))? This package allows you toso.you.can.use.dot(notation)!```
npm install --save inheritable-map
To inherit from Map in ES6 and add a toString override, do the following:
`js
import { InheritableMap } from 'inheritable-map';
class Table extends InheritableMap {
toString() {
return this.__toString('Table {', '}');
}
}
`
To do the same thing in ES5:
`js
var InheritableMap = require('inheritable-map').InheritableMap;
function Table() {
InheritableMap.prototype.constructor.apply(this, arguments);
}
Table.prototype = Object.create(InheritableMap.prototype);
Table.prototype.toString = function toString() {
return this.__toString('Table {', '}');
}
`
Now you can construct an instance of your Map based class (ES5/ES6):
`js``
var table = new Table();