Skip to content

Commit 2f73b0c

Browse files
authored
Merge pull request #3554 from wjdittmar/patch-2
Update part6b.md
2 parents a43f4a4 + da569e6 commit 2f73b0c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/content/6/en/part6b.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,18 @@ The following is printed to the console
657657
658658
The output is interesting but not very useful. This is about the previously mentioned Immer library used by the Redux Toolkit internally to save the state of the Store.
659659
660-
The status can be converted to a human-readable format, e.g. by converting it first to a string and then back to a JavaScript object as follows:
660+
The status can be converted to a human-readable format by using the [current](https://redux-toolkit.js.org/api/other-exports#current) function from the immer library.
661+
662+
Update the imports to include the "current" function from the immer library:
663+
664+
```js
665+
import { createSlice, current } from '@reduxjs/toolkit' // highlight-line
666+
```
667+
668+
Then update the console.log function call:
661669
662670
```js
663-
console.log(JSON.parse(JSON.stringify(state))) // highlight-line
671+
console.log(current(state)) // highlight-line
664672
```
665673
666674
Console output is now human readable

0 commit comments

Comments
 (0)