This is a helper to creating things like keys, actionTypes, or enum objects.
npm install kenum
import kenum from 'kenum'
const actionType = kenum.appName`
REQ
RES
ERR
`
output:
actionType = {
REQ: 'appName/REQ',
RES: 'appName/RES',
ERR: 'appname/ERR'
}
import kenum from 'kenum'
const FOO = 'FOO'
const BAR = 'BAR'
const actionType = kenum.appName`
REQ
${FOO}
RES
${BAR}
ERR
`
output:
actionType = {
REQ: 'appName/REQ',
RES: 'appName/RES',
ERR: 'appName/ERR',
FOO: 'appName/FOO',
BAR: 'appName/BAR'
}