How can I shim ambient to act like state?
# compose
a
How can I shim ambient to act like state?
k
you could use
Recompose { recompose -> }
a
Do I wrap that around ambient?
or the whole thing
How does it work?
I was looking at Recompose earlier, but the API isn’t clear and Google doesn’t say much about it
I guess my question is, how can I recompose automatically, as opposed to just calling recompose
r
I would not recommend any approach involving manual recomposition, as one of the principles of Compose is that it recomposes automatically based on changes, without any imperative invocations like that
👌 1
l
@andrew it’s not clear to me what you are wanting and how it’s relating to ambients. Can you write pseudo-code demonstrating what you want to be able to do?
a
I'm using ambients like contexts in react, I expected it to update, the class. I think I was think of it wrong, but now I'm using recompose. I can hook you up with some pseudo code in a bit, I'm afk atm
It works now because I'm using recompose on the components provider, and set up a subscriber to history to know when to recompose
l
if you’d like, send me the code you ended up with. i suspect there might be an easier way to accomplish what you’re wanting