1.0.7 • Published 4 years ago
generate-react-redux-cli v1.0.7
Generate-React-Redux-Cli
A simple CLI to generate react components and create redux store, actions, and reducers
Install
npm i -g generate-react-redux-cliUsage
Note: create reducer before creating store.
| Flags | Description | Value Type |
|---|---|---|
| c | to create component | |
| r | to create a reducer | |
| s | to create a redux store | |
| a | to create an action | |
| -p | to specify a path | |
| -t | type of a component | functional/class |
To create a component
generate-react-redux c ExampleExample of the component files structure
|-- /src
|-- /components
|-- /Example.jsxTo create a reducer
generate-react-redux e ExampleReducerExample of the component files structure
|-- /src
|-- /reducers
|-- /ExampleReducer.js
|-- /rootReducer.jsTo create a store
generate-react-redux sExample of the component files structure
|-- /src
|-- /store
|-- /index.jsTo create an action
generate-react-redux a ExampleActionExample of the component files structure
|-- /src
|-- /actions
|-- /ExampleAction.jsOptions
path e.g src/components
generate-react-redux c Example -p src/pages/componentsExample of the component files structure
|-- /src
|-- /pages
|-- /components
|-- /Example.jsxgenerate-react-redux c Example -p src/pages/componentsExample of the component
generate-react-redux c Example -p src/pages/components -t class