Mirroring to keys and values from array of strings
npm i mirror-key-value
import mirrorKeyValue from 'mirror-key-value';
mirrorKeyValue(['val1', 'val2']); // => { val1: 'val1', val2: 'val2' }
Create action types of Flux application as an example use
// action-types.js
export default mirrorKeyValue([
'ADD_TODO',
'DELETE_TODO',
'CHANGE_COMPLETE'
]);
//
import types from './constants/action-types';
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
© sugarshin