@vlaaad thanks! I did look at the example but was unsure how to combine it with *context
and its cache-mechanism. Will try it later today or tomorrow.
I’ve setup an app with create-app
and it works well to mutate the context through app actions. I would however like to be able to mutate the context from the REPL. How do I achieve that? (Similar to how I in re-frame can call (dispatch [:event/1])
straight from the REPL.
You store reference to context atom in a def and just swap it with fx/swap-context
Like example above: (swap! *context fx/swap-context assoc :style style)
— that will put style to :style
key in a context
Hmm, that didn’t update the displayed value though
It correctly updated the atom but the changes aren’t visible in the app
Hmm, can you make a repro/share some code?
For sure
Nvm, I had put defonce app
(to avoid recreating the window every time), but not defonce *context
.
Updating that fixed it 😄