This micromodule creates and caches functions that access a property on an object, primarily for use in D3.
npm install accessorize
HTML:
<script src="accessorize.js"></script>
JavaScript:
var a = createAccessorizer();
a.createBasicAccessor('id');
d3.selectAll('.guy').data(guys, a.id);
Run tests with npm test
. Run tests in the debugger with 'npm run-script dtest'.
MIT.