cljfx

https://github.com/cljfx/cljfx
jlmr 2019-12-29T08:12:10.011100Z

@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.

vikeri 2019-12-29T13:16:21.014300Z

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.

vlaaad 2019-12-29T13:19:14.014400Z

You store reference to context atom in a def and just swap it with fx/swap-context

vlaaad 2019-12-29T13:22:01.014700Z

Like example above: (swap! *context fx/swap-context assoc :style style) — that will put style to :style key in a context

vikeri 2019-12-29T13:23:02.015500Z

Hmm, that didn’t update the displayed value though

vikeri 2019-12-29T13:23:29.016200Z

It correctly updated the atom but the changes aren’t visible in the app

vlaaad 2019-12-29T13:24:53.016300Z

Hmm, can you make a repro/share some code?

vikeri 2019-12-29T13:25:36.016500Z

For sure

vikeri 2019-12-29T13:29:56.017300Z

Nvm, I had put defonce app (to avoid recreating the window every time), but not defonce *context.

vikeri 2019-12-29T13:30:04.017600Z

Updating that fixed it 😄

👍 1