Fork me on GitHub

@gadfly361 Heres what I ended up with. To summarise my problem, I’m trying to define the pathways/decision tree for my business logic in my event handler. I do not want to bounce around functions (or events) trying to map in my head what the logic is doing.


This allows me to define the condition and the path for a branch. I can also chain events together (For example http-xhrio).


I will likely add more ways to branch (cond, case, when ect) as I need them if this works out.


@caleb.macdonaldblack thanks! Looking over the code, definitely intrigued by this approach. Excited for later when I can play around a bit in the repl and get a feel for it. Keep up the creativity!


Let me know any feedback you have 🙂


Hello all, sorry about my silly question, but I saw many examples, but nothing with re-frame/reagent to clear explain how do I use the select with option with re-frame/reagent? How to set :value and :on-change, is that the same as input?


I have an effect handler (`reg-fx`). I want to store the item that is created in the effect in the db. What is the best way to do this?


@fabrao Should be the same, yeah. @erwinrooijakkers Effects can cause side-effects, so you can just use (reset! db some-new-db-value). For an example you can look the the :db effect handler implementation.


Okay I injected the effects via cofx into a reg-event-db, but it is a bit much indirection


If reg-event-fx can just create some stuff and add it to the database it is clearer



 [(re-frame/inject-cofx :one-thing-that-uses-my-value)
  (re-frame/inject-cofx :another-thing-that-uses-one-thing-obtained-from-cofx)]
 (fn [{:keys [db one-thing another-thing] :as cofx} [_ my-value]]
   {:db (assoc db
               ::one-thing one-thing
               ::another-thing another-thing)}))


And I meant creating the stuff in a let block and then associng it to the db is clearer