如何在kroma.runtime / on-message中响应调用者

时间:2017-09-24 01:53:12

标签: javascript google-chrome google-chrome-extension clojure clojurescript

我正在使用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”作为参数调用。但事实并非如此。

我做错了什么?

0 个答案:

没有答案