symbol-keymirror

Takes an array of string and returns an object with the string as key, and Symbol(key) as the value


Keywords
javascript, symbol, keymirror
License
MIT
Install
npm install symbol-keymirror@0.1.3

Documentation

symbol-keymirror NPM TravisCI

How to install?

$ npm install --save symbol-keymirror

How to use?

object: symbolKeyMirror([String]) Takes an array of string and returns an object with the string as key, and Symbol(key) as the value

const symbolKeyMirror = require('symbol-keymirror');
const keys = [
  'ADD_ITEM',
  'REMOVE_ITEM'
];

const symbols = symbolKeyMirror(keys);

symbols.ADD_ITEM; //Symbol('ADD_ITEM')