From 38932ff6140c38a04baa823762d68894acc8be1c Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Wed, 6 Nov 2024 19:27:50 -0500 Subject: [PATCH 1/2] Add top Redux.dev banner --- website/docusaurus.config.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index e466b231c8..d29fdf7643 100755 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -26,6 +26,21 @@ module.exports = { colorMode: { disableSwitch: false }, + announcementBar: { + id: 'redux-dev-course', + content: ` + + Redux.dev - a new course by Mark Erikson + ui.dev - Learn more + + `, + backgroundColor: '#fafbfc', + textColor: '#091E42', + isCloseable: false + }, navbar: { title: 'Redux', logo: { From 345bdfe486ae3ed444df58c973baf944a7e796c3 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Wed, 6 Nov 2024 19:28:05 -0500 Subject: [PATCH 2/2] Clarify import/export syntax usage --- docs/tutorials/essentials/part-2-app-structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/essentials/part-2-app-structure.md b/docs/tutorials/essentials/part-2-app-structure.md index 0af585028e..0592bc52b5 100644 --- a/docs/tutorials/essentials/part-2-app-structure.md +++ b/docs/tutorials/essentials/part-2-app-structure.md @@ -161,7 +161,7 @@ The Redux store is created using the `configureStore` function from Redux Toolki 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. -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. +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.) 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.