Skip to content

Instantly share code, notes, and snippets.

@ilake
Created July 8, 2015 06:46
Show Gist options
  • Save ilake/df13e2306f142f460b07 to your computer and use it in GitHub Desktop.
Save ilake/df13e2306f142f460b07 to your computer and use it in GitHub Desktop.
fetch(BASE_URL + url, request_objs)
.then((response) => response.json())
.then((responseData) => {
console.log({"responseData": responseData});
responseHandler(responseData)
})
VS
fetch(BASE_URL + url, request_objs)
.then((response) => {response.json()})
.then((responseData) => {
console.log({"responseData": responseData});
responseHandler(responseData)
})
@ilake
Copy link
Author

ilake commented Jul 8, 2015

.then((response) => {response.json()}) response.json() 的部份 有被{} 包起來跟沒包起來差在哪阿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment