Skip to content

Commit 945f98a

Browse files
committed
Add missing code snippets for Part 8
1 parent 90b3352 commit 945f98a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/tutorials/essentials/part-8-rtk-query-advanced.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ import {
13161316
} from '@reduxjs/toolkit'
13171317
// omit imports and other code
13181318

1319+
// highlight-next-line
13191320
const notificationsReceived = createAction<ServerNotification[]>('notifications/notificationsReceived')
13201321

13211322
export 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"

0 commit comments

Comments
 (0)