Skip to content

Instantly share code, notes, and snippets.

@andreystarkov
Last active October 17, 2019 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreystarkov/4659535a7453ec0474b732309653ba0f to your computer and use it in GitHub Desktop.
Save andreystarkov/4659535a7453ec0474b732309653ba0f to your computer and use it in GitHub Desktop.
stores

Short story about stores

This is how redux store folder struture should look like:

Core principles:

  • One file - one entity
  • Upcoming imports

Reducer file example:

Action file example:

Reducers index.js:

Same for action folder index.js:

Top store's index.js

Usage

Import anything from store and use it whatever you want

  import {addressCount, fetchAddressDetails, AddressReducers, AddressActions} from 'Stores/AddressStore'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment