forked from reduxjs/redux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitBook: [master] 140 pages modified
- Loading branch information
1 parent
6e6de51
commit 2ef44e9
Showing
84 changed files
with
2,873 additions
and
3,112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Advanced | ||
|
||
In the [basics walkthrough](../basics/), we explored how to structure a simple Redux application. In this walkthrough, we will explore how AJAX and routing fit into the picture. | ||
|
||
* [Async Actions](asyncactions.md) | ||
* [Async Flow](asyncflow.md) | ||
* [Middleware](middleware.md) | ||
* [Usage with React Router](usagewithreactrouter.md) | ||
* [Example: Reddit API](exampleredditapi.md) | ||
* [Next Steps](https://github.com/reactjs/redux/tree/master/docs/advanced/NextSteps.md) | ||
|
151 changes: 77 additions & 74 deletions
151
docs/advanced/AsyncActions.md → advanced/asyncactions.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# Async Flow | ||
|
||
Without [middleware](Middleware.md), Redux store only supports [synchronous data flow](../basics/DataFlow.md). This is what you get by default with [`createStore()`](../api/createStore.md). | ||
Without [middleware](middleware.md), Redux store only supports [synchronous data flow](../basics/dataflow.md). This is what you get by default with [`createStore()`](../api/createstore.md). | ||
|
||
You may enhance [`createStore()`](../api/createStore.md) with [`applyMiddleware()`](../api/applyMiddleware.md). It is not required, but it lets you [express asynchronous actions in a convenient way](AsyncActions.md). | ||
You may enhance [`createStore()`](../api/createstore.md) with [`applyMiddleware()`](../api/applymiddleware.md). It is not required, but it lets you [express asynchronous actions in a convenient way](asyncactions.md). | ||
|
||
Asynchronous middleware like [redux-thunk](https://github.com/gaearon/redux-thunk) or [redux-promise](https://github.com/acdlite/redux-promise) wraps the store's [`dispatch()`](../api/Store.md#dispatch) method and allows you to dispatch something other than actions, for example, functions or Promises. Any middleware you use can then interpret anything you dispatch, and in turn, can pass actions to the next middleware in the chain. For example, a Promise middleware can intercept Promises and dispatch a pair of begin/end actions asynchronously in response to each Promise. | ||
Asynchronous middleware like [redux-thunk](https://github.com/gaearon/redux-thunk) or [redux-promise](https://github.com/acdlite/redux-promise) wraps the store's [`dispatch()`](../api/store.md#dispatch) method and allows you to dispatch something other than actions, for example, functions or Promises. Any middleware you use can then interpret anything you dispatch, and in turn, can pass actions to the next middleware in the chain. For example, a Promise middleware can intercept Promises and dispatch a pair of begin/end actions asynchronously in response to each Promise. | ||
|
||
When the last middleware in the chain dispatches an action, it has to be a plain object. This is when the [synchronous Redux data flow](../basics/DataFlow.md) takes place. | ||
When the last middleware in the chain dispatches an action, it has to be a plain object. This is when the [synchronous Redux data flow](../basics/dataflow.md) takes place. | ||
|
||
Check out [the full source code for the async example](ExampleRedditAPI.md). | ||
Check out [the full source code for the async example](exampleredditapi.md). | ||
|
||
## Next Steps | ||
|
||
Now that you've seen an example of what middleware can do in Redux, it's time to learn how it actually works, and how you can create your own. Go on to the next detailed section about [Middleware](Middleware.md). | ||
Now that you've seen an example of what middleware can do in Redux, it's time to learn how it actually works, and how you can create your own. Go on to the next detailed section about [Middleware](middleware.md). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.