v1.1.0
- Added effects && reducers to define model;
- Added more documents: Upgrade Guidelines.
Change log
It is no longer recommended to use actions to define model, please use reducers && effects. #66
1.0.0:
const model = {
state: 0,
actions: {
increment:(prevState) => prevState + 1,
async decrementAsync(prevState, payload, actions) {
await delay(1000);
return prevState - 1;
},
},
};
1.1.0:
const model = {
state: 0,
reducers: {
increment:(prevState) => prevState + 1,
decrement:(prevState) => prevState - 1,
},
effects: {
async decrementAsync(state, payload, actions) {
await delay(1000);
actions.decrement();
},
},
};