Morpha-Store
A Redux Store for Morpha.
Guide
{ let nextId = 0 return store: initialState: todos: other: 'other' get: statetodoslength set: { return ...state todos: statetodos } { return ...state todos: statetodos } action: // 不并发... async { const dataList = await dataList return true } { store // fetch action store } { { return todos: statetodos addTodo: settersaddTodo delTodo: settersdelTodo length: getterslength } // subscribe action const Container = store { return <div> <div> Totoal: length </div> <ul> todos </ul> <button onClick= > AddTodo</button> </div> } const el = document documentbody ReactDOM } }