https://github.com/robertherber/template-redux-module
SAO template to generate Redux Modules under an existing project
https://github.com/robertherber/template-redux-module
duck-typing javascript modules react react-native redux sao template
Last synced: 3 months ago
JSON representation
SAO template to generate Redux Modules under an existing project
- Host: GitHub
- URL: https://github.com/robertherber/template-redux-module
- Owner: robertherber
- License: mit
- Created: 2018-02-15T01:59:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-15T19:25:27.000Z (over 8 years ago)
- Last Synced: 2026-01-07T06:49:56.448Z (6 months ago)
- Topics: duck-typing, javascript, modules, react, react-native, redux, sao, template
- Language: JavaScript
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# template-redux-module
[](https://circleci.com/gh/robertherber/template-redux-module) 
> SAO template to generate a Redux Module
[SAO](https://github.com/egoist/sao) is a scaffolding tool.
Use this SAO template to generate one new redux module in your project. This is not meant to set up the base structure - but rather add new modules adhering to the structure that's described below.
The template will generate a folder with the following files:
* `modules//actions.js`
* `modules//reducer.js`
* `modules//selectors.js`
It will also generate a `__tests__` folder with corresponding files and example tests:
* `modules//__tests__/actions.js`
* `modules//__tests__/reducer.js`
* `modules//__tests__/selectors.js`
If you want to put your module at another relative path - use the second parameter to SAO to specify another folder (see Usage for examples).
Obviously this is an opinionated Redux structure and is meant as such. For me I find it easy to work with - and I feel it scales well in bigger projects. Do feel free to contribute your thoughts on how to improve this template.
## Usage
Install [SAO](https://github.com/egoist/sao) first.
```bash
yarn global add sao
# or
npm i -g sao
```
### From npm
```bash
sao redux-module
```
or if you want to specify your own folder instead of 'modules/':
```bash
sao redux-module redux-stuff/my-own-modules-folder
```
### From git
```bash
sao robertherber/template-redux-module
```
or if you want to specify your own folder instead of 'modules/':
```bash
sao robertherber/template-redux-module redux-stuff/my-own-modules-folder
```
## License
MIT © [Robert Herber](https://github.com/robertherber)