I have a event handler called some-handler and a event called someevent following works when doing it in javascript,
window.onsomeevent = space.some_handler;
I have been googling for nearly an hour but I can not find how to do this in clojurescript?
Here's a snippet to add a mousedown listener to window. Look here for the other google closure event types: http://closure-library.googlecode.com/svn/docs/closure_goog_events_eventtype.js.source.html
(ns example
(:require
[goog.dom :as dom]
[goog.events :as events]))
(def w (dom/getWindow))
(events/listen w (.-MOUSEDOWN events/EventType) #(js/alert "Handle Mouse Down"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With