Cancel all tasks in login flow
See original GitHub issueI have this saga:
function* authorizedFlow() {
let payload
while (({payload} = yield take(actions.LOGIN_SUCCESS))) {
const { access_token } = payload
yield race({
watchers: yield [
call(refreshUser, access_token),
call(refreshActivities, access_token),
call(refreshPendingTransactions, access_token)
],
logout: yield take(actions.LOGOUT_SUCCESS)
})
console.info("authorizedFlow: Logged out")
}
}
I would like to cancel all the watchers when the LOGOUT_SUCCESS
action was sent. The cancel
method does not seem to accept an array of tasks. Whats the most elegant way to cancel those watchers. Is that flow a good pattern anyway? Of course each watcher could race against the LOGOUT_SUCCESS
itself but I’d like to keep them clean.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Cancelling all tasks when a new one is created - Stack Overflow
I am trying to cancel any task that are running when a user changes their selection and start a new task . I...
Read more >Flow to delete Open Tasks when opportunity is stage = Archived
What I need to do is if an opportunity is marked as Stage = "Archived" i need a flow to check if there...
Read more >Cancel all running flow runs for a flow in an environment
Do you want to automate the cancellation of running Power Automate flow runs? Microsoft 365 CLI cmdlets will help you to cancel all...
Read more >How do I cancel "In Progress" tasks - Okta Support
I assume one way is to turn off the flow, copy it, and then move on from the copied flow. That would at...
Read more >5 Ways to Stop a Flow in Power Automate
The Cancel Flow Run action requires you to input three values. ... Unfortunately, there is no way to list all the Run IDs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pke Ok I missed your first example. Inside race, you shouldn’t yield effects just specify them
closing this. ESlint rules is tracked in #179