scope-types
v1.1.2
Published
Helper function for scoping a list of action types.
Downloads
8
Maintainers
Readme
Scope Types
Helper function for scoping a list of action types.
Installation
Using npm:$ npm install scope-types
Using yarn:$ yarn add scope-types
Usage
/* actionTypes.js */
import scopeTypes from 'scope-types'
const types = ['MY_WILD_TYPE', 'MY_SWELL_TYPE', 'MY_SLICK_TYPE']
const customScope = 'myThrillingScope'
const actionTypes = scopeTypes(types, customScope)
/*
actionTypes = {
MY_WILD_TYPE: Symbol('myThrillingScope/MY_WILD_TYPE'),
MY_SWELL_TYPE: Symbol('myThrillingScope/MY_SWELL_TYPE')
MY_SLICK_TYPE: Symbol('myThrillingScope/MY_SLICK_TYPE')
}
*/
export default actionTypes
Usage With Redux Logger
If you are planning on using with Redux Logger be sure to look at this issue.