Thread
#compose
    andrew

    andrew

    2 years ago
    How can I shim ambient to act like state?
    kioba

    kioba

    2 years ago
    you could use
    Recompose { recompose -> }
    andrew

    andrew

    2 years ago
    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

    Ryan Mentley

    2 years ago
    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
    l

    Leland Richardson [G]

    2 years ago
    @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?
    andrew

    andrew

    2 years ago
    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

    Leland Richardson [G]

    2 years ago
    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