 (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 {}


(def messages (chan))

(def root (.getElementById js/document "app"))

(defn submit [message]


(defn main [initial-model view update]
  (go-loop [model initial-model]
           (q/render (view model) root)
           (let [message (<! messages)
                 [updated-model effect] (update model message)]
             (printaction message model updated-model effect)
             (if-not (nil? effect) (>! effects effect))
             (recur updated-model))))

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

