File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
docs/tutorials/essentials Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1316,6 +1316,7 @@ import {
13161316} from ' @reduxjs/toolkit'
13171317// omit imports and other code
13181318
1319+ // highlight-next-line
13191320const notificationsReceived = createAction <ServerNotification []>(' notifications/notificationsReceived' )
13201321
13211322export const apiSliceWithNotifications = apiSlice .injectEndpoints ({
@@ -1345,6 +1346,9 @@ export const apiSliceWithNotifications = apiSlice.injectEndpoints({
13451346 draft .push (... message .payload )
13461347 draft .sort ((a , b ) => b .date .localeCompare (a .date ))
13471348 })
1349+
1350+ // Dispatch an additional action so we can track "read" state
1351+ lifecycleApi .dispatch (notificationsReceived (message .payload ))
13481352 break
13491353 }
13501354 default :
@@ -1420,7 +1424,7 @@ Let's take one last look at the whole application in action:
14201424
14211425<iframe
14221426 class="codesandbox"
1423- src="https://codesandbox.io/embed/github/reduxjs/redux-essentials-example-app/tree/checkpoint-6-rtkqConversion/?codemirror=1& fontsize=14&hidenavigation=1&theme=dark&runonclick=1"
1427+ src="https://codesandbox.io/embed/github/reduxjs/redux-essentials-example-app/tree/feature/tutorial-steps-ts-post-review/? fontsize=14&hidenavigation=1&theme=dark&runonclick=1"
14241428 title="redux-essentials-example-app"
14251429 allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
14261430 sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
You can’t perform that action at this time.
0 commit comments