Sun Mar 12 2023 14:43:23 GMT+0000 (Coordinated Universal Time)
Saved by @chelobotix #reduxaction.payload
dispatch(myAction('value1', 'value2')); function myReducer(state, action) { switch (action.type) { case 'MY_ACTION': const { var1, var2 } = action.payload; // do something with var1 and var2 return newState; default: return state; } }
#reduxaction.payload
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments