Gcaufy 4f07b2cfa5 feat: added ci release support | 4 年 前 | |
---|---|---|
.. | ||
dist | 4 年 前 | |
CHANGELOG.md | 4 年 前 | |
README.md | 5 年 前 | |
helper.js | 5 年 前 | |
index.js | 5 年 前 | |
install.js | 5 年 前 | |
package.json | 4 年 前 |
npm install @wepy/redux redux --save
wepy.use(wepyRedux);
2. Initialize a store
// ~/store.js import { createStore, combineReducers } from 'redux';
export default createStore(combineReducers({ counter (state = { num: 0 }, action) {
switch (action.type) {
case 'ADD':
return {
...state,
num: state.num + 1
};
}
return state;
} }));
3. Map to Component
// ~/counter.wpy