Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Commit

Permalink
update: use immer in redux slice
Browse files Browse the repository at this point in the history
  • Loading branch information
osamaqarem committed Jun 18, 2020
1 parent 10c60ab commit 0c8cd7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions template/src/redux/slices/exampleSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const exampleSlice = createSlice({
name: "example",
initialState,
reducers: {
ping: (state) => ({ ...state, globalValue: 'PING' }),
pong: (state) => ({ ...state, globalValue: 'PONG' }),
ping: (state) => { state.globalValue = 'PING' },
pong: (state) => { state.globalValue = 'PONG' },
},
})

Expand Down

0 comments on commit 0c8cd7f

Please sign in to comment.