create redux action type constants
$ yarn add --dev babel-plugin-create-redux-action-type
$ npm install --save-dev babel-plugin-create-redux-action-type
In:
/* @flow */
type HOGE_TYPE = 'hoge/HOGE_ACTION'
type FUGA_TYPE = 'fuga/FUGA_ACTION'
type Action = { +type: HOGE_TYPE | HUGA_TYPE }
Out:
// @flow
import type { HOGE_TYPE, FUGA_TYPE } from './actionTypes';
export const HOGE: HOGE_TYPE = 'hoge/HOGE_ACTION';
export const FUGA: FUGA_TYPE = 'fuga/FUGA_ACTION';"
{
"plugins": [
"create-redux-action-type"
]
}
MIT © akameco