Fork me on GitHub
#re-frame
<
2016-11-18
>
borkdude16:11:23

if I want to rewrite this to reg-event-db:

(reg-event-fx
 :search/update-autocomplete
 [(path :search)]
 (fn [{:keys [:db]} [_ operation idx el]]
   {:db (update db :autocomplete
                operation
                idx el)}))
I would try this:
(reg-event-db
 :search/update-autocomplete
 [(path :search)]
 (fn [{:keys [:db]} [_ operation idx el]]
   (update db :autocomplete
                operation
                idx el)})

borkdude16:11:37

but that doesn’t work, what am I missing?

borkdude16:11:56

probably the first argument for the function should be db only

borkdude16:11:49

that’s it