I would like to update an object in the middle of processing redux I need to check if this is first time for a function.
here is my code.
const initialState = {
table: [],
timer: 0,
result: "",
gameState: false,
openedCount: 0,
isFirst: true
};
what I tried
if(state.isFirst) {
state.isFirst = false;
}
How do I update like that in redux? just want to update for isFirst not returning state.
I will return { ...state, table: newArray }
I would really appreciate your help thanks for reading my question.