Hello everyone. I am having a problem with navigat...
# decompose
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 :
. The configuration
has a store which load data from repository with onAction. The user can navigate to configuration B
. The user also can navigate back to configuration A
. 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
of component of Configuration.A. My question: is it correct that approach??? Are there a way simpler to make that???
That looks valid. Intent.Refresh should work.
ok arkadii. One suggestion : when create the Store add the possibility to choose what method (onCreate, onStart, onResume) trigger the onAction . What do you think??
What kind of Action? If it's MVIKotlin, then Actions are produced by the Bootstrapper.
yes, action of the Bootstrapper
Bootstrapper by definition runs only once. The easiest solution is to add an explicit Intent.Refresh.
I got, so ok. tks