Skip to content

recruit-tech/redux-page-scope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-page-scope

Installation

npm install --save redux-page-scope

Usage

Installing Reducers

import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { pageScopeReducer } from 'redux-page-scope';

const rootReducer = combineReducers({
  routing: routerReducer,
  page: pageScopeReducer(combineReducers({
    // your reducers for page scope.
  })),
  ...
});

Installing middlewares

import { createStore, applyMiddleware } from 'redux';
import { browserHistory } from 'react-router';
import { routerMiddleware } from 'react-router-redux';
import pageScopeMiddleware from 'redux-page-scope';
import rootReducer from './reducers';

const store = createStore(
  rootReducer,
  applyMiddleware(
    routerMiddleware(browserHistory),
    pageScopeMiddleware()
  )
);

About

Page scope state management for Redux

Resources

License

Stars

Watchers

Forks

Packages

No packages published