cljfx

Emmanuel S 2026-02-10T04:37:08.119419Z

hi friends I'm new to cljfx/JavaFX and Clojure in general Say I have a text area or HTMLEditor pane in my window, and say I want to make a button that, on-press, will take the content of the text area and dump it in a file. Now I see in the https://github.com/cljfx/cljfx/blob/master/examples/e20_markdown_editor.clj that the way to do this is by swapping the text into the state atom at every text edit, but I'm wondering if it would be more performant to only get the text from the component on the press event? And if so, how would I do that, would I do that with ext-let-refs /`ext-let-refs`? Thanks!

vlaaad 2026-02-10T08:42:29.460489Z

if you keep your text in a string, and use the string from state to create a text field using cljfx, the JavaFX node will use the same string object, so there is no difference in perf/memory use…

Emmanuel S 2026-02-10T12:41:08.211819Z

ah thanks! how simple, that's pretty great