Coder Social home page Coder Social logo

robertherber / template-redux-module Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 43 KB

SAO template to generate Redux Modules under an existing project

License: MIT License

JavaScript 100.00%
sao template redux duck-typing modules javascript react react-native

template-redux-module's Introduction

template-redux-module

CircleCI NMPVersion

SAO template to generate a Redux Module

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/<your module name>/actions.js
  • modules/<your module name>/reducer.js
  • modules/<your module name>/selectors.js

It will also generate a __tests__ folder with corresponding files and example tests:

  • modules/<your module name>/__tests__/actions.js
  • modules/<your module name>/__tests__/reducer.js
  • modules/<your module name>/__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 first.

yarn global add sao
# or
npm i -g sao

From npm

sao redux-module

or if you want to specify your own folder instead of 'modules/':

sao redux-module redux-stuff/my-own-modules-folder

From git

sao robertherber/template-redux-module

or if you want to specify your own folder instead of 'modules/':

sao robertherber/template-redux-module redux-stuff/my-own-modules-folder

License

MIT © Robert Herber

template-redux-module's People

Contributors

robertherber avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.