Created
November 21, 2017 12:20
-
-
Save harukaeru/65f7c2be27cb02221fc13a67864164ae to your computer and use it in GitHub Desktop.
ES6
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
const wait = time => new Promise(resolve => setTimeout(resolve, time)) | |
const x = (...args) => { | |
console.log('-----------------------------') | |
console.log(...args) | |
} | |
wait(1000) | |
.then(() => fetch('https://www.google.co.jp', { header: "same-origin" })) | |
.then(response => response.text()) | |
.then(text => x('this is the response', text)) | |
.catch(e => console.error(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
www.google.co.jp
で実行しないとthen
が呼ばれないです