0.1.2 • Published 7 years ago

babel-plugin-create-redux-action-type v0.1.2

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

babel-plugin-create-redux-action-type Build Status

create redux action type constants

Install

yarn

$ yarn add --dev babel-plugin-create-redux-action-type

npm

$ npm install --save-dev babel-plugin-create-redux-action-type

Example

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';"

Usage

{
  "plugins": [
    "create-redux-action-type"
  ]
}

License

MIT © akameco