1.0.2 • Published 5 years ago

babel-plugin-actions v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

babel-plugin-actions

Babel plugin to generate traceable type for the-actions.

Issues related to the-actions should be reporter on the-actions issue-tracker.

Install

npm install --save-dev babel-plugin-actions

Usage

Run:

babel --plugins actions script.js

Or add the plugin to your .babelrc configuration:

{
  "plugins": [ "actions" ]
}

Example

The plugin will compile the following code:

// actions.js
const UserAction = ActionCreator();
const OtherActions = {
    Example: ActionCreator()
}

into:

// actions.js
const UserAction = ActionCreator("actions.js: UserAction");
const OtherActions = {
    Example: ActionCreator("actions.js: OtherActions.Example")
}