sanji-redux-ui
v1.2.0
Published
sanji-redux-ui
Downloads
32
Readme
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.
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
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