sanji-redux-ui

1.2.0 • Public • Published

sanji-redux-ui

Sanji redux helper service is part of Sanji UI framework and also it is a angular module. It is just a ng-redux wrapper and help configure the application store.

NPM Package Quality Build Status Coverage Status Codacy Badge dependencies devdependencies semantic-release Commitizen friendly

Dependencies

Installation

Sanji redux helper is based on es6 + webpack to development and embrace npm to install it.

npm install sanji-redux-ui --save

How to use

const category = (state = {}, {type, payload}) => {
  switch (type) {
  case 'GET_CURRENT_CATEGORY':
    return payload || { name: undefined };
  default:
    return state;
  }
};
angular.module('webapp', ['sanji.redux'])
.config(reduxHelperProvider => {
  'ngInject';
  reduxHelperProvider.configure({
    category
  });
})
.run((reduxHelper) => {
  'ngInject';
  const test = (state = [], {type, payload}) => {
    switch (type) {
    case 'GET_CATEGORIES':
      return payload || state;
    default:
      return state;
    }
  };
  // Dynamically inject reducer
  reduxHelper.injectAsyncReducer('test', test);
});

Integrate Chrome Redux Devtool Extention

Redux DevTools extension

reduxHelperProvider.configure({
    category
}, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());

Contact

Author: Zack Yang © 2016

Support: if you find any problems with this library, open issue on Github

Readme

Keywords

Package Sidebar

Install

npm i sanji-redux-ui

Weekly Downloads

8

Version

1.2.0

License

MIT

Last publish

Collaborators

  • zack9433