What's the downside of `derivedStateOf` ? If `reme...
# compose
c
What's the downside of
derivedStateOf
? If
remember
takes a dependency list, I assume it's somehow better for performance to use it rather than deriving the state? Is there a list of cases where it's recommended or not?
m
i think that assumption might be false. derivedState should be more performant than remember keys. Simple because derivedState is like a ‘distinctUntilChanged’. Meaning, a combination of state leading to the same result won’t be recomposed. I dont think the same applies to keys,
c
Oh. I thought there would be some kind of cost associated with automatically detecting which state objects should be watched for changes. I guess the fact that this is not possible in other frameworks made me think it had to be expensive.
m
that would be a really strong guess tho. Better advise yourself with some1 with compose team. But i’m pretty positive