so.. i am planning to use redux to store the state...
# redux
n
so.. i am planning to use redux to store the state of a boardgame (figure positions mostly) 1. what is the correct way for a reducer to fail ? eg. from a illegal action by the player 2. is it a smart idea to serialize the actions and have the client send to the server ? 3. assuming thats not a stupid idea.. can i hook up the store to autmatically send any changes via network (ktor and websocket)
r
reducer never fails - it just puts the failure into the state object (e.g. an error message which will be displayed)
n
would throwing a exception get passed through to the
store.dispatch(action)
call ?
r
reducer should be pure function - imho it should never throw an exception
n
so i should store error and handle it afterwards ? guess that works too