Last active
November 7, 2020 18:12
-
-
Save lumosmind/17245d190c5b6dc27f43b826a5418b3e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let id = 21; | |
function executor (resolve, reject){ | |
getData(id, resolve) | |
}; | |
const myPromise = new Promise(executor); | |
myPromise | |
.then((result)=>{ | |
//adım 1 | |
console.log(result); | |
id = 22; | |
return new Promise(executor); | |
}) | |
.then((result)=>{ | |
//adım 2 | |
console.log(result); | |
id = 23; | |
return new Promise(executor); | |
}) | |
.then((result)=>{ | |
//adım 3 | |
console.log(result); | |
id = 24; | |
return new Promise(executor); | |
}) | |
.then((result)=>{ | |
//adım 4 | |
console.log(result); | |
id = 25; | |
return new Promise(executor); | |
}) | |
.then((result)=>{ | |
//adım 5 | |
console.log(result); | |
id = 26; | |
return new Promise(executor); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment