Skip to content

Commit

Permalink
Missing function tags
Browse files Browse the repository at this point in the history
Summary:
It seems like it's not written in es6, hence no arrow functions, therefor we must have the function tag for it to work?
Closes #9463

Differential Revision: D3736797

fbshipit-source-id: c41bbd5f6867aa0f7668f8562e69dc2812eba80a
  • Loading branch information
bsthomsen authored and Facebook Github Bot 6 committed Aug 18, 2016
1 parent 4b6af5f commit aacfc37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The above examples show how you can make a request. In many cases, you will want
Networking is an inherently asynchronous operation. Fetch methods will return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that make it straightforward to write code that works in an asynchronous manner:

```js
getMoviesFromApiAsync() {
function getMoviesFromApiAsync() {
return fetch('https://facebook.github.io/react-native/movies.json')
.then((response) => response.json())
.then((responseJson) => {
Expand All @@ -62,7 +62,7 @@ Networking is an inherently asynchronous operation. Fetch methods will return a
You can also use the proposed ES2017 `async`/`await` syntax in a React Native app:

```js
async getMoviesFromApi() {
async function getMoviesFromApi() {
try {
let response = await fetch('https://facebook.github.io/react-native/movies.json');
let responseJson = await response.json();
Expand Down

0 comments on commit aacfc37

Please sign in to comment.