actiontypes
A dead simple a bit opinionated utility to generate namespaced strings for Flux standard actions.
Usage
Basic
import actionTypes from 'actiontypes';
const actions = actionTypes(
'simple',
'HELLO',
'THERE'
);
You'll got:
console.log(actions);
{
HELLO: 'simple/HELLO',
THERE: 'simple/THERE'
}
Configuration
import actionTypes from 'actiontypes';
const actions = actionTypes(
'namespace',
'OPEN',
'CLOSE',
'close',
'tYPO',
'TOGGLE',
{
prefix: '@@',
delimeter: '--',
}
);
And you'll got:
console.log(actions);
{
OPEN: '@@namespace--OPEN',
CLOSE: '@@namespace--CLOSE',
TYPO: '@@namespace--TYPO',
TOGGLE: '@@namespace--TOGGLE'
}