 
 ;; ------------------------------------------------
 
-(defn example-add [actx out-ch x y delay]
+(defn example-add [actx x y delay]
   (ago example-add actx
        (<! (timeout delay))
-       (aput example-add out-ch (+ x y))
-       (aclose example-add out-ch))
-  out-ch)
+       (+ x y)))
 
-(defn example-sub [actx out-ch x y delay]
+(defn example-sub [actx x y delay]
   (ago example-sub actx
        (<! (timeout delay))
-       (aput example-sub out-ch (- x y))
-       (aclose example-sub out-ch))
-  out-ch)
+       (- x y)))
 
-(def cmd-handlers {"add" (fn [out-ch]
+(def cmd-handlers {"add" (fn []
                            (let [x (js/parseInt (get-el-value "x"))
                                  y (js/parseInt (get-el-value "y"))
                                  fence (get-el-value "fence")
                                  delay (js/parseInt (get-el-value "delay"))]
-                             {:rq #(example-add % out-ch x y delay) :fence (= fence "1")})),
-                   "sub" (fn [out-ch]
+                             {:rq #(example-add % x y delay) :fence (= fence "1")})),
+                   "sub" (fn []
                            (let [x (js/parseInt (get-el-value "x"))
                                  y (js/parseInt (get-el-value "y"))
                                  fence (get-el-value "fence")
                                  delay (js/parseInt (get-el-value "delay"))]
-                             {:rq #(example-sub % out-ch x y delay) :fence (= fence "1")}))})
+                             {:rq #(example-sub % x y delay) :fence (= fence "1")}))})
 
 (defn vis-init []
   (let [cmds (merge [(listen (gdom/getElement "add") "click")


(ns cbfg.core
  (:require-macros [cljs.core.async.macros :refer [go go-loop]]
                   [cbfg.ago :refer [ago ago-loop achan-buf aclose aput atake]])
  (:require [clojure.string :as string]
            [cljs.core.async :refer [<! >! put! chan timeout merge]]
            [goog.dom :as gdom]

                               (recur (conj acc result))))]
           (ago-loop main-in w-actx []
                     (let [cmd (.-id (.-target (<! cmds)))
                           cmd-handler ((get cmd-handlers cmd))]
                       (aput main-in in cmd-handler)
                       (recur)))))))

(vis-init)
