Gcaufy 4f07b2cfa5 feat: added ci release support | před 4 roky | |
---|---|---|
.. | ||
dist | před 4 roky | |
CHANGELOG.md | před 4 roky | |
README.md | před 5 roky | |
helper.js | před 5 roky | |
index.js | před 5 roky | |
install.js | před 5 roky | |
package.json | před 4 roky |
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