-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
Description
Expected Behavior
useAsyncEffect(function* () {
while (true) {
try {
const something = yield Promise.reject(new Error('Something went wrong.'))
// 2. "something" return the rejected promise, on the second iteration
debugger
} catch (err) {
// 1. catch, happen the first time
debugger
}
}
}, [])
Should always hit the catch
.
Current Behavior
On the first iteration of the loop, yield
throw, and it's caught by the try catch. On the second iteration, same code run, but this time something
will contain the rejected promise itself.