Proper way to cancel effects? #2450
-
Wondering the proper way to cancel effects when a feature is dismissed. The child feature will run various network queries or timers and when the feature is dismissed I would cancel any in-flight queries or timers. The question is where in the child feature can I put the cancel code? If I use
There isn't a SwiftUI-equivalent to the UIKit |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @sillygoose, are you using the presentation tools that come with the library, such as |
Beta Was this translation helpful? Give feedback.
-
I 1000% love your username @sillygoose . Would you like to swap? |
Beta Was this translation helpful? Give feedback.
Hi @sillygoose, are you using the presentation tools that come with the library, such as
PresentationState
,PresentationAction
,ifLet
, etc? If so, those tools automatically cancel effects when a feature is dismissed. And if not, is there a reason not to?