Creates an effect that instructs the middleware to return whether this
generator has been cancelled. Typically you use this Effect in a finally
block to run Cancellation specific code
Example
function* saga() {
try {
// ...
} finally {
if (yield cancelled()) {
// logic that should execute only on Cancellation
}
// logic that should execute in all situations (e.g. closing a channel)
}
}
Creates an effect that instructs the middleware to return whether this generator has been cancelled. Typically you use this Effect in a finally block to run Cancellation specific code
Example
function* saga() { try { // ... } finally { if (yield cancelled()) { // logic that should execute only on Cancellation } // logic that should execute in all situations (e.g. closing a channel) } }