|
|
|
|
|
by consilient
1100 days ago
|
|
People often get confused because they expect `await` to sequence promise resolution too. For example const example = async () => {
const ifError = Promise.reject("something went wrong")
const value = await someOtherPromise()
await (valueIsOk(value) ? runNextStep(value) : ifError)
}
will always throw. |
|