When I try to execute "updateHex" action I got this error: "ERROR TypeError: Cannot assign to read only property 'hexType' of object '[object Object]'"
Here is the complete stacktrace:
hex-matrix-facade.ts:27 ERROR TypeError: Cannot assign to read only property 'hexType' of object '[object Object]' at hex-matrix.reducer.ts:30:7 at ngrx-immer-shared.mjs:9:42 at Immer2.produce (immer.mjs:570:20) at ngrx-immer-shared.mjs:9:16 at ngrx-store.mjs:1682:22 at combination (ngrx-store.mjs:345:31) at ngrx-store.mjs:1108:23 at ngrx-store.mjs:375:14 at computeNextEntry (ngrx-store-devtools.mjs:506:17) at recomputeStates (ngrx-store-devtools.mjs:536:48)
Here is my state and reducer: `export interface AppState { hexMatrix: HexMatrixState; }
export interface HexMatrixState { hexLines: HexLine[]; }
export const initialState: HexMatrixState = { hexLines: [], };
export const hexMatrixReducer = createReducer( initialState, immerOn(loadHexMatrix, (state, action) => { state.hexLines = [...action.hexMatrix.hexLines]; return state; }), immerOn(updateHex, (state, action) => { state.hexLines[action.hexCoordenates.line].hexes[ action.hexCoordenates.column ].hexType = action.hexType; return state; }) );`
When I try to execute "updateHex" action I got this error: "ERROR TypeError: Cannot assign to read only property 'hexType' of object '[object Object]'"
Here is the complete stacktrace:
hex-matrix-facade.ts:27 ERROR TypeError: Cannot assign to read only property 'hexType' of object '[object Object]' at hex-matrix.reducer.ts:30:7 at ngrx-immer-shared.mjs:9:42 at Immer2.produce (immer.mjs:570:20) at ngrx-immer-shared.mjs:9:16 at ngrx-store.mjs:1682:22 at combination (ngrx-store.mjs:345:31) at ngrx-store.mjs:1108:23 at ngrx-store.mjs:375:14 at computeNextEntry (ngrx-store-devtools.mjs:506:17) at recomputeStates (ngrx-store-devtools.mjs:536:48)