Hello! I have just started exploring the library and wondering if the recommended approach for interactive programming is still this: https://github.com/cljfx/cljfx/blob/master/examples/e12_interactive_development.clj More specifically, is running "renderer" to re-load the window still the right way in version 1.9.x?
I'm new at using cljfx too. I call renderer directly because I'm using a different engine to manage my state (odoyle-rules). So I think if you are in a similar boat, or you just like handling rendering more directly, this is still valid. However, it seems from reading further in the readme, that there or some extra helpers that would call render for you that watches your state atom and optionally caches computed values, etc. So if that is your situation, you might want to go that route.
Thank you, @pauld. Do you have any special trick to call renderer for smoother workflow, or just manually evaluate the function every time to reload the window? Just out of curiosity, could you tell me why you chose cljfx over clojuredart or web-based approaches? (Simply, what are you building?) I have started looking at cljfx because I thought it would be easier (with no additional set-up necessary, can use libraries I'm already using) and was attracted to the "desktop first" idea, but having doubts about my ability to understand the library (as an inexperienced, beginner coder).
If you have your application state in an atom, you should probably just do as shown at the end of the 'Atoms' section of the README:
(def renderer
(fx/create-renderer
:middleware (fx/wrap-map-desc assoc :fx/type root)))
;; Convenient way to add watch to an atom + immediately render app
(fx/mount-renderer *state renderer)Now whenever *state changes, the app rerenders.
I chose cljfx because I'm integrating with a swing / javafx legacy app at work.
Thanks for your reply!