Zoltan Demant
02/07/2022, 7:37 AM@Immutable
due to the state changing quite frequently, and a lot of composables depending on that state.
Unfortunately its not possible to mark a function variable @Immutable/Stable
(and I can understand why).
Ive tried creating a wrapper class which is @Immutable
, but my composable functions eventually accept the wrapped value and therefore lose out on the fact that its immutable. Im not able to refactor my code to accept the wrapper class (without a major headache, there are 758 cases like this).
Due to the sheer amount of classes that would be marked immutable, Id very much prefer to not mark each individual one (or subclass a marked interface). They are always immutable.
@Immutable
interface Screen
Is there another way?