我正在使用kroma编写chrome扩展程序。
我在popup.cljs中调用了以下函数:
(defn my-caller-function [timer]
(runtime/send-message {:foo :bar
:responseCallback do-something}))
我正在我的background.cljs中收听消息
(defn init []
(go-loop
[]
(when-let [message (<! (runtime/on-message))]
(process-message (:message message))
; here I'm trying to respond to my popup with "foo"
; but do-something is not called
(apply (:response-fn message) "foo")
(recur))))
据我所知do-something
应该以“foo”作为参数调用。但事实并非如此。
我做错了什么?