babel-plugin-s2s-action-creater

1.0.1 • Public • Published

babel-plugin-s2s-action-creater

generate action types

Install

$ npm install --save-dev babel-plugin-s2s-action-creater

Usage

in:

// @flow
export const ADD: 'App/ADD' = 'App/ADD'

export const Actions = {
  ADD,
}

export type Add = {
  type: typeof ADD,
  payload: number,
}

export type Action = Add

out:

// @flow
import { ADD } from './actionTypes'
import type { Add } from './actionTypes'

export function add(payload: number): Add {
  return {
    type: ADD,
    payload,
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-s2s-action-creater

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

8.93 kB

Total Files

5

Last publish

Collaborators

  • akameco