Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default function reducer(state:IPlayersStatState = initialState, action:IAction): IPlayersStatState {
  2.   switch (action.type) {
  3.     case SET: {
  4.       const { id, speed } = action.payload;
  5.       return update(state, {
  6.         [id]: (cur:IPlayerStatState) => update(cur || initialPlayerState, {$set: {speed}})
  7.       });
  8.     }
  9.     default: return state;
  10.   }
  11. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement