-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store.cancelAll() #335
Store.cancelAll() #335
Conversation
|
Related to this discussion |
|
What do you think? Is this a good approach? If I write tests for this, can it be merged? |
|
Hey @hfossli! Sorry for not weighing in. Your solutions have definitely been on our radar, and we've been thinking about the problem and various solutions, but we haven't quite decided what direction to take yet. Thanks for sharing, though! We'll try to take a closer look soon. |
|
Thanks! That means a lot to hear :) It is definetely a tricky one. Looking forward to hear your thoughts. 🥰 |
|
Bump; I could really make use of something like this now. I assumed that when the state of the optional reducer is |
|
@hfossli 👋 We've been thinking about this problem for awhile and because we haven't had a solution we've been happy with, we've left all PRs open to think about. Our Concurrency Beta provides one new solution, though, that we'd love your opinion on. Namely, it begins to return a task handle from .task { await viewStore.send(.onAppear) }When the view goes away, it cancels this task and all effects spun up by the associated action will be cancelled, as well. |
Glad to know there is a solution in the works. We are using TCA in a fairly large scale project at the moment (and loving it!) but have run into the same issues being documented here with long-living effects not being cancelled. |
|
@hfossli It's taken awhile but we've finally arrived at some cancellation helpers we're happy with, so we're going to close these related PRs out. I think we're a bit worried about
Thanks again for taking the time to open these PRs and contribute to the conversation! If you have anything you'd like to discuss about our solutions, we'd love to hear about it. Please start a GitHub discussion! |
Related to a discussion (coming in some minutes) on Swift Forums