Why can't I return the new state in this way (reset action)?
export interface TodosModel {
items: string[];
reset: Action<TodosModel>;
}
const todos: TodosModel = {
items: [],
// This action does not update the state
reset: action(() => {
return {
items: []
};
})
};
I'm trying to achieve what is described here: https://github.com/ctrlplusb/easy-peasy/issues/146
Working example: https://codesandbox.io/s/easy-peasy-typescript-v3-vzc11