-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
const M = new MuRDAMap(new MuVarint(), new MuRDARegister(new MuVarint()))
const store = M.createStore({0: 0, 1: 1})
const dispatchers = M.action(store)
// { type: 'move', data: MuStruct { id: 1, key: 0, sequence: 2 } }
const mv = dispatchers.move(1, 0)
// { type: 'move', data: MuStruct { id: 2, key: 1, sequence: 1 } }
const mvi = store.inverse(M, mv)
store.apply(M, mv)
// { type: 'move', data: MuStruct { id: 2, key: 1, sequence: 1 } }
const mvr = dispatchers.move(0, 1)The problem comes from we expect applying two identical action objects to the same state to result in different states. Since we're not supposed to touch the state when generating action objects or inverses, either mvi or mvr has to carry extra info to differentiate itself from the other.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels