Replies: 1 comment
-
Hi @krze, hypo will need to provide more information of how you are presenting the settings screen. Can you show the reducer code that executed when presenting settings, as well as the view code that presents the settings view? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found the super-handy
signpost()
function on reducers and decided to take a look in instruments to check performance. I found something I don't understand, maybe I'm interpreting it wrong:In my app, I have a Settings view that you can enter from the main view. When the Settings view appears, I send an
onAppear
Action to its reducer. In response to theonAppear
Action, that reducer sets up initial state and returns apublisher
effect that maps another publisher to fire anotherAction
when that publish receives a new value.While viewing the signposts in instruments for my Settings reducer's
onAppear
Action, I see that it keeps running even after the view is dismissed. While this is understandable as I usescope
to create the Settings reducer from the app's main reducer, I don't understand why theAction
itself is long-running. Here's a screenshot from instruments, I apologize for cutting off some of the entry due to propriety but bear with me:In this instruments run, I entered and left the Settings view twice. After the initial
onAppear
theAction
kept running according to the signposts. This is under theAction
signpost category, not theEffect
categoryIf I send
onAppear
to the store usingawait store.send(.onAppear).finish()
this stops occurring.Should I be calling
finish()
on sending actions with long-running publishers? Or is instruments potentially not reporting this correctly? Or, alternatively, is this a non-issue?Beta Was this translation helpful? Give feedback.
All reactions