Skip to content

Instantly share code, notes, and snippets.

@KenoLeon
Last active April 12, 2022 00:36
Show Gist options
  • Select an option

  • Save KenoLeon/2c8a199bd28d8d10e145f6c488dd4953 to your computer and use it in GitHub Desktop.

Select an option

Save KenoLeon/2c8a199bd28d8d10e145f6c488dd4953 to your computer and use it in GitHub Desktop.
multiple Promises no chaining
// NO chaining:
const EVM_OPERATION_01 = new Promise((resolve) => {
setTimeout(() => {
resolve('Done with Operation 01');
}, 600); // timeout of 600ms to simulate the operation
});
const EVM_OPERATION_02 = new Promise((resolve) => {
setTimeout(() => {
resolve('Done with Operation 02');
}, 800); // timeout of 800ms to simulate the operation
});
EVM_OPERATION_01.then(result => {
console.log(result);
});
EVM_OPERATION_02.then(result => {
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment