Skip to content

Testing out an idea for modularizing redux components using a scoped store

License

Notifications You must be signed in to change notification settings

bsingr/redux-scope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-scope

Basic idea

  1. redux action types are prefixed with a scope (your-action becomes path/to/scope/your-action)
  2. components must NOT know about this; instead they use scoped versions of getState() and dispatch()
  3. reducers must NOT know about this; instead they scope is removed before they receive their actions

Features

  • provides scoped versions of getState() and dispatch() of redux
  • provides scoped version of redux store that can be passed to connect() of react-redux
  • provides scoped versions of your reducer functions

Sequence

SEQUENCE

Usage

import {scopeGetState, scopeDispatch, scopeReducer, scopeStore} from 'redux-react'

...

Try out

See examples/accounts.js.

  • Install npm install
  • Tests npm test
  • Examples node examples/accounts.js

About

Testing out an idea for modularizing redux components using a scoped store

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published