Sean Proctor
02/08/2024, 2:57 PMinstanceKeeper
. When the component leaves the stack, onDestroyed
is called on the data. When the component is re-added to the stack, the same data is returned by instanceKeeper.getOrCreate
that had been previously destroyed. This is with 3.0.0-alpha05.Arkadii Ivanov
02/08/2024, 3:53 PMInstance#onDestroy
is called? Do you mean the same instance (by reference) is returned later again?Sean Proctor
02/08/2024, 3:55 PMArkadii Ivanov
02/08/2024, 3:55 PMArkadii Ivanov
02/08/2024, 3:55 PMSean Proctor
02/08/2024, 3:56 PMArkadii Ivanov
02/08/2024, 3:56 PMSean Proctor
02/08/2024, 5:15 PMArkadii Ivanov
02/08/2024, 5:21 PMArkadii Ivanov
02/08/2024, 5:21 PMArkadii Ivanov
02/08/2024, 5:25 PMSean Proctor
02/08/2024, 6:41 PMgetOrCreate
lambda. My factory was accidentally returning the same data.Arkadii Ivanov
02/08/2024, 6:45 PMSean Proctor
02/08/2024, 7:03 PMelectrolobzik
02/09/2024, 8:23 AMArkadii Ivanov
02/09/2024, 8:58 AMchildContext
.electrolobzik
02/09/2024, 9:21 AMComponent
interface which will have something like val componentContext: ComponentContext
in this case when the component is created by any fabric method the base implementation of that method can save/check the context (also removing the contexts of dead components via subscription to their lifecycles). This is not ideal for sure, but at least it will force some rules, required for a correct work. P.S. In my case I already have every component implementing ComponentContext by context
so it probably will not change much in the client code. So the only change for the users will be obligatory use of T: ComponentContext
instead of just <T>
in all decompose methods.electrolobzik
02/09/2024, 9:25 AM<T: LifecycleOwner>
because as I understand the lifecycle is the main point where it is important for child components to have child context.electrolobzik
02/09/2024, 9:26 AMelectrolobzik
02/09/2024, 9:28 AMArkadii Ivanov
02/09/2024, 9:32 AMthis
) and passed to another Component's constructor.Arkadii Ivanov
02/09/2024, 9:34 AMArkadii Ivanov
02/09/2024, 9:40 AM