Veams Blueprint :: Redux
With this blueprint you can scaffold a whole store slice in your application.
Let's say you have a module called articles
and you want to add a store slice to that module,
then you can use Veams to do that automatically for you by using this blueprint.
Setup
- First of all be sure you have installed
veams-cli
. - After that be sure your project contains a
veams-cli.json
. - Make sure you have updated
veams-cli.json
to fit the needs of your project. - Install the package with
npm i veams-bp-redux --save-dev
. - Reference the package in
veams-cli.json
by adding store
to the blueprint
object like so:
{
"blueprints": {
"store": {
"skipImports": true,
"prompts": "node_modules/veams-bp-redux/prompts",
"templates": "node_modules/veams-bp-redux/templates"
}
}
}
Usage
Now you can use this blueprint with veams
by executing:
veams add store modules/articles
The output will be:
├── articles
├── services
│ └── articles.service.js
└── store
├── articles.actions.js
├── articles.epics.js
├── articles.reducer.js
├── articles.selectors.js
└── articles.state.js
Every file is configured and prefixed with articles
, because that is the namespace you used in the terminal.
Have fun!