Skip to content

Commit

Permalink
Merge pull request #4481 from reduxjs/docs/modern-redux-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Feb 12, 2023
2 parents ece840f + 8c7b389 commit 5c6d100
Show file tree
Hide file tree
Showing 4 changed files with 1,166 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/introduction/why-rtk-is-redux-today.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,5 @@ See these docs pages and blog posts for more details
- [Redux Essentials: Redux App Structure](../tutorials/essentials/part-2-app-structure.md)
- [Redux Fundamentals: Modern Redux with Redux Toolkit](../tutorials/fundamentals/part-8-modern-redux.md)
- [Redux Style Guide: Best Practices and Recommendations](../style-guide/style-guide.md)
- [Presentation: Modern Redux with Redux Toolkit](https://blog.isquaredsoftware.com/2022/06/presentations-modern-redux-rtk/)
- [Mark Erikson: Redux Toolkit 1.0 Announcement and development history](https://blog.isquaredsoftware.com/2019/10/redux-toolkit-1.0/)
4 changes: 2 additions & 2 deletions docs/tutorials/fundamentals/part-4-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,15 @@ Any middleware can return any value, and the return value from the first middlew

```js
const alwaysReturnHelloMiddleware = storeAPI => next => action => {
const originalResult = next(action);
const originalResult = next(action)
// Ignore the original result, return something else
return 'Hello!'
}

const middlewareEnhancer = applyMiddleware(alwaysReturnHelloMiddleware)
const store = createStore(rootReducer, middlewareEnhancer)

const dispatchResult = store.dispatch({type: 'some/action'})
const dispatchResult = store.dispatch({ type: 'some/action' })
console.log(dispatchResult)
// log: 'Hello!'
```
Expand Down
Loading

0 comments on commit 5c6d100

Please sign in to comment.