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?I'm afraid it's impossible :/
damn
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?
I would just use event map
Event map handler receives an event too, so this logic can be moved there
nice, will do that, thanks again!!!