Fork me on GitHub
#cljfx
<
2021-08-26
>
JAtkins21:08:28

Does cljfx have documentation available on what components are built in, and what types go where?

vlaaad05:08:18

Built in components are in the source code :)

vlaaad05:08:35

What types go where isn't...

vlaaad05:08:09

I wanted to create specs for cljfx, but I don't have the time now unfortunately

JAtkins06:08:52

. Might be able to get better docs for cljfx soon. Will see if I can build it in cljfx 🙂

jvtrigueros22:08:57

Hi, I'm having issues understanding how state is supposed to flow. I've create a minimal example that shows my issue. In short, I want to create a component that has a button and a text field beside it. On click of the button, a DirectoryChooser pops up and when a directory is selected, the path is filled into the text field. As is, my global state is correct, but the UI doesn't reflect the state. The text field remains blank. I believe my issue is in the directory-input component as the :text value isn't ready until after the :on-action is triggered. I can make this work by reaching out to *state in directory-input, but I would really like to use this pure approach. Here's a gist if it makes it easier to read: https://gist.github.com/jvtrigueros/721da14b0aa6fb693ba9c1a8ed2359de Any pointers would be greatly appreciated 🙇

jvtrigueros14:08:05

Thank you! I started with one example and then took pieces from another example, I changed the arg to wrap-map-desc

(fx/wrap-map-desc
  (fn [state] (root-view state)))
Then everything works now! Thank you so much!

vlaaad15:08:42

Np 🙂 (fx/wrap-map-desc #'root-view) will also work similarly

jvtrigueros15:08:55

Oh that actually might work better, thanks for the tip!

jvtrigueros15:08:42

With that change, now I just need to eval the root-view