Hello everyone. I am having a problem with navigation between two components (well, the problem is not related with navigation but with management of their lifecycles). I am using
Child Stack Navigation
with two configurations :
A
and
B
. The configuration
A
has a store which load data from repository with onAction. The user can navigate to configuration B
"navigate.push(Configuration.B)"
. The user also can navigate back to configuration A
"navigate.pop()"
.
So the stack is in this way :
User opens the application : [A*] (data loaded from repository)
User navigates to configuration B : [A, B*] (navigate.push(Configuration.B))
User goes back to configuration A : [A] (navigation.pop())
When the user goes back to configuration A the data is not loaded from repository again because the onAction is not called once the store was not destroyed. I thought to remove the data load of the onAction and creating a Intent for that. And calling that Intent in
lifecycle.onStart()
of component of Configuration.A. My question: is it correct that approach??? Are there a way simpler to make that???