This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0a16ab
commit 89f3a91
Showing
3 changed files
with
37 additions
and
0 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,5 @@ | ||
{ | ||
"plugins": [ | ||
["../../../src"] | ||
] | ||
} |
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,10 @@ | ||
async function handler() { | ||
var response = await fetch('http://address'); | ||
if (!response.ok) { | ||
return null; // 1 | ||
} | ||
var json = await response.json(); // 2 | ||
return { | ||
a: 3 | ||
}; | ||
} |
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,22 @@ | ||
function handler() { | ||
var response, json; | ||
return Promise.resolve().then(function () { | ||
return fetch('http://address'); | ||
}).then(function (_resp) { | ||
response = _resp; | ||
|
||
if (!response.ok) { | ||
return null; // 1 | ||
} else { | ||
return Promise.resolve().then(function () { | ||
return response.json(); | ||
}).then(function (_resp) { | ||
json = _resp; // 2 | ||
|
||
return { | ||
a: 3 | ||
}; | ||
}); | ||
} | ||
}); | ||
} |