dave08
05/08/2023, 1:06 PMsimon.vergauwen
05/08/2023, 1:16 PMclose them when unusedNo, that sounds highly mutable and the
Map
somehow needs to know when it goes out-of-scope.HotSwap
which I've also ported, but have not bothered bringing to Arrow. It's to basically open and use Resource
on rotation.
https://github.com/nomisRev/arrow-fx-coroutines-utils/blob/main/src/commonMain/kotlin/io/github/nomisrev/Hotswap.ktdave08
05/08/2023, 1:22 PMopen and useIf I try to retreive this same resource from the map when it's closed, it'll re-open it?on rotation.Resource
simon.vergauwen
05/08/2023, 1:59 PM@Composeable
has it's own Resource
? A @Composeable
can listen to when it gets destroyed, right?
I guess there could be some integration there, using Resource.allocated
🤔 I am not familiar enough with Compose, and it's been a long time since I did Android but it might be possible.@Composeable
that doesn't gets retriggered on recomposition, and supports suspend. Is there something like rememberLaunchedEffect
where you can attach a Unit
key (so it ignores recomposition) and can you then attach some listener to be invoked when they view gets destroyed?
Then it should be possibledave08
05/08/2023, 2:01 PM