Skip to content

Commit 9d1dcb2

Browse files
authored
[Docs - Advanced - Async Actions] remove note about fetch
Obsolete and irrelevant for redux tutorial.
1 parent 0564281 commit 9d1dcb2

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

docs/advanced/AsyncActions.md

-18
Original file line numberDiff line numberDiff line change
@@ -395,24 +395,6 @@ export function fetchPosts(subreddit) {
395395
}
396396
```
397397

398-
> ##### Note on `fetch`
399-
>
400-
> We use [`fetch` API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) in the examples. It is a new API for making network requests that replaces `XMLHttpRequest` for most common needs. Because most browsers don't yet support it natively, we suggest that you use [`cross-fetch`](https://github.com/lquixada/cross-fetch) library:
401-
>
402-
> ```js
403-
> // Do this in every file where you use `fetch`
404-
> import fetch from 'cross-fetch'
405-
> ```
406-
>
407-
> Internally, it uses [`whatwg-fetch` polyfill](https://github.com/github/fetch) on the client, and [`node-fetch`](https://github.com/bitinn/node-fetch) on the server, so you won't need to change API calls if you change your app to be [universal](https://medium.com/@mjackson/universal-javascript-4761051b7ae9).
408-
>
409-
> Be aware that any `fetch` polyfill assumes a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) polyfill is already present. The easiest way to ensure you have a Promise polyfill is to enable Babel's ES6 polyfill in your entry point before any other code runs:
410-
>
411-
> ```js
412-
> // Do this once before any other code in your app
413-
> import 'babel-polyfill'
414-
> ```
415-
416398
How do we include the Redux Thunk middleware in the dispatch mechanism? We use the [`applyMiddleware()`](../api/applyMiddleware.md) store enhancer from Redux, as shown below:
417399

418400
#### `index.js`

0 commit comments

Comments
 (0)