我按照这个例子: https ://github.com/Day8/re-frame/blob/master/docs/FAQs/PollADatabaseEvery60.md
这是我的间隔处理程序
(defonce interval-handler
(fn [{:keys [action id frequency event]}]
(let [live-intervals (atom {})]
(condp = action
:start (swap! live-intervals assoc id (js/setInterval #(re-frame/dispatch event) frequency))
:end (do (js/clearInterval (get live-intervals id))
(swap! live-intervals dissoc id))))))
(re-frame/reg-fx
:interval
interval-handler)
我正在尝试从此处的另一个事件中分派此间隔事件:
(re-frame/reg-event-db
:start-playing
(fn [db _]
(re-frame/dispatch [:interval {:action :start
:id :some-awesome-id
:frequency 1000
:event [:tick]}])
(assoc db :is-playing? true
:fake (random-active-color db)
:real (random-active-color db))))
但它说re-frame: no :event handler registered for: :interval
这不可能吗?