cljfx

https://github.com/cljfx/cljfx
2020-11-21T14:53:24.150800Z

hellow everybody! what is a good way of accessing the event-handler fn inside a component? I know we can dispatch events with a event map, but I need to do it with a function like

:on-selection-changed (fn [ev]
                        (when (.isSelected (.getTarget ev))
                          (event-handler {:event/type ...})))
Is there a way of accessing the dispatch fn like we access the context inside components, without the need of a global reference?

vlaaad 2020-11-21T15:04:39.150900Z

I'm afraid it's impossible :/

2020-11-21T15:36:27.151100Z

damn

2020-11-21T15:37:46.151300Z

what do you think is the best solution in this case, just dispatch with a event map and apply that .isSelected logic on the event-handler or create a global reference with event-handler?

vlaaad 2020-11-21T15:38:49.151500Z

I would just use event map

vlaaad 2020-11-21T15:40:25.151700Z

Event map handler receives an event too, so this logic can be moved there

2020-11-21T15:40:47.151900Z

nice, will do that, thanks again!!!