Skip to content

Commit e841f80

Browse files
authored
Merge pull request #4752 from reduxjs/docs/course-banners
Add top Redux.dev banner
2 parents 56aaa38 + 345bdfe commit e841f80

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docs/tutorials/essentials/part-2-app-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ The Redux store is created using the `configureStore` function from Redux Toolki
161161
162162
Our application might be made up of many different features, and each of those features might have its own reducer function. When we call `configureStore`, we can pass in all of the different reducers in an object. The key names in the object will define the keys in our final state value.
163163
164-
We have a file named `features/counter/counterSlice.ts` that exports a reducer function for the counter logic. We can import that `counterReducer` function here, and include it when we create the store.
164+
We have a file named `features/counter/counterSlice.ts` that exports a reducer function for the counter logic as the ESM "default" export. We can import that function into this file. Since it's a default export, we can give that variable any name we want when we import it into this file. In this case, we call it `counterReducer` here, and include it when we create the store. (Note that [the import/export behavior here is standard ES Module syntax](https://javascript.info/import-export#export-default), and not specific to Redux.)
165165
166166
When we pass in an object like `{counter: counterReducer}`, that says that we want to have a `state.counter` section of our Redux state object, and that we want the `counterReducer` function to be in charge of deciding if and how to update the `state.counter` section whenever an action is dispatched.
167167

website/docusaurus.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ module.exports = {
2626
colorMode: {
2727
disableSwitch: false
2828
},
29+
announcementBar: {
30+
id: 'redux-dev-course',
31+
content: `
32+
<a href="https://redux.dev">
33+
<img
34+
src="/img/course-callout-wide.svg"
35+
alt="Redux.dev - a new course by Mark Erikson + ui.dev - Learn more"
36+
style="margin-top: 5px;"
37+
/>
38+
</a>
39+
`,
40+
backgroundColor: '#fafbfc',
41+
textColor: '#091E42',
42+
isCloseable: false
43+
},
2944
navbar: {
3045
title: 'Redux',
3146
logo: {

0 commit comments

Comments
 (0)