 (defrecord Increment []
   Action
   (run [this model]
-    (update model :counter inc)))
+    [(update model :counter inc) nil]))
 
 (defrecord Decrement []
   Action
   (run [this model]
-    (update model :counter dec)))
+    [(update model :counter dec) nil]))
+
+(defrecord SetCounter [value]
+  Action
+  (run [this model]
+    [(assoc model :counter value) nil]))
 
 (defrecord GenerateRandom []
   Action
-  (run [this model] model))
+  (run [this model]
+    [model (->Random ->SetCounter)]))
+
+(defrecord PrintSomething []
+  Action
+  (run [this model]
+    [model (->Print)]))
 
 (defrecord Type [text]
   Action
   (run [this model]
-    (assoc model :text (:text this))))
+    [(assoc model :text (:text this)) nil]))
 
 (defn view [model]
   (d/div {}


(defn main [initial-model view update]
  (go-loop [model initial-model]
           (println model)
           (q/render (view model) root)
           (recur (update model (<! messages)))))

;; ******************************************************************


              (:counter model)
              (d/button {:onClick (fn [e] (submit (->Increment)))} "+"))
         (d/p {} (d/button {:onClick (fn [e] (submit (->GenerateRandom)))} "Random"))
         (d/p {} (d/button {:onClick (fn [e] (submit (->PrintSomething)))} "Print something"))
         (d/p {}
              (d/input {:onChange (fn [e] (let [value (-> e (.-target) (.-value))]
                                            (submit (->Type value))))
