Skip to content

goldsziggy/kenum

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kenum

Key + Enum = kenum

This is a helper to creating things like keys, actionTypes, or enum objects.

Installing

npm install kenum

Usage

import kenum from 'kenum'

const actionType = kenum.appName`
  REQ
  RES
  ERR
`

output:

actionType = {
  REQ: 'appName/REQ',
  RES: 'appName/RES',
  ERR: 'appname/ERR'
}

With variables

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'
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%