Leo N
Feb 2, 2025

--

Thank for your idea but for my opinion as well as android official docs:

"Avoid CompositionLocal for concepts that aren't thought as tree-scoped or sub-hierarchy scoped. A CompositionLocal makes sense when it can be potentially used by any descendant, not by a few of them." We should not use CompositionLocal for this case because

1. The shimmer is locally for individual modifier, and do we consider this modifier as a node of compose-tree?

2. It's not apply for app descendants.

3. You share here but there is no disclaimer, this may cause misunderstand should or should not we use it.

4. The usages of this approach is limited and hard to maintenance.

Looking forward to see your expanding in this. Thanks

--

--

Leo N
Leo N

Written by Leo N

🇻🇳 🇸🇬 🇲🇾 🇦🇺 🇹🇭 Engineer @ GXS Bank, Singapore | MSc 🎓 | Technical Writer . https://github.com/nphausg

No responses yet