Cool findings, Shreyas!
Will it have the same effect if we use a state object instead of a value producing lambda?. Passing State< T > instead of () -> T?
As in this case as well state reads would be deferred too.
Using State as a parameter is somehow not considered as a best practice by the officials. So won't recommend that (I'm not aware of an actual reason though). But lambdas in compose are optimized and there should be no harm in using them.
Yes, lambdas should do the trick.
I've also read this sentiment about passing State as a param in some online forums too, but didn't find any concrete reasoning. If you have any references from credible sources please do share!