Fork me on GitHub

I was just taking another look at vrac. It seems like there's a lot of similarities with Is there an example for how effects might work?

(defc todo-item-comp [todo-item]
  {:id :my-app/todo-item}
  [:.title {:class {:done? (:todo-item/done? todo-item)}}
           (:todo-item/title todo-item)])
How would you emit a :toggle-todo for todo-item when the user clicks on the todo item?

Vincent Cantin03:09:09

@U7RJTCH6J It would look like:

(defc todo-item-comp [todo-item]
  {:id :my-app/todo-item}
  [:div.title {:class [(when (:todo-item/done? todo-item)
               :on-click [:toggle-todo todo-item]}
   [:todo-item/title todo-item]]])