我正在尝试编写一个 clojureScript One 项目,但在删除事件侦听器(未侦听)时遇到问题 - 侦听器已使用以下代码注册:
(defn- add-expand_fold-listener
"Accepts a ele-id and creates listeners for click events on div
which will then fire rendering changes"
[ele-id]
(log/log "adding opening listeners")
(event/listen (single-node (by-id ele-id))
"click"
#(dispatch/fire (re-class ele-id "foldup" "expand"))))
但是当我尝试用这段代码不听时:
(defn- remove-expand_fold-listener
"Accepts a ele-id and removes listener for click events on div"
[ele-id]
(log/log "removing opening listener")
(event/unlisten (by-id ele-id)
"click"
#(dispatch/fire (re-class ele-id "foldup" "expand"))
false)
(log/log "done removing listener"))
代码运行没有错误,但监听器没有被删除,我想我有一个语法错误,但我不确定在哪里。
任何帮助将不胜感激。谢谢拉里