                                      )]
                               ]}))
 
+  ((query ^todo {:name :todo/edit-text}
+          (+ todo)) (-> @todo :kn))
 
   (enable-console-print!)
   )

                                     (+s (hiccup
                                          [:li {:id (str "todo" id) :entity id :event-key "todo" :events ["onDoubleClick"]}
                                           text]))
                                     (+ {:name :ui/child :id "todo-list" :child (str "todo" id) :pos order}))
                               (rule {:name "todo" :id id :text text :order order}
                                     {:name "todo-editing" :id id :editing? "true"}
                                     (+s (hiccup
                                          [:input {:id (str "todo-editor") :entity id :event-key "todo-editor" :defaultValue text :events ["onChange" "onKeyDown" "onBlur"]}]))
                                     (+ {:name :ui/child :id "todo-list" :child (str "todo-editor") :pos order}))
                               ]
                              [(rule {:name :todo/current-text :value v}
                                     (+s (hiccup

                             (- {:name :ui/event-listener :id id :entity entity :event event}))
                       ])

  (def timer-cleanup-rules [(rule {:name :wait :time t :id i}
                                  (- {:name :wait :time t :id i}))])

  (def io-cleanup-rules [(rule ^get {:name :http-get}
                               (- get))])


  (def tick (run-env {:kn #{[3 5] [9 8 7] [:tick]}
                      :cleanup-rules (concat ui-cleanup-rules timer-cleanup-rules
                                             [])
                      :tick-rules [(rule [:tick]
                                         (- [:tick])
                                         (+ {:name :wait :time 1000 :id 1}))]
                      :rules [(rule {:name :tick :id 1 :timestamp ts}
                                    (+ [:tick])
                                    (+ ["hi!" ts]))]}))

  (pause tick)
  (unpause tick)
  @tick

  (def clock (run-env {:kn #{{:name :tick :id "clock"}}
                       :cleanup-rules (concat ui-cleanup-rules timer-cleanup-rules
                                              [])
                       :tick-rules [(rule {:name :tick :id "clock"}
                                          (+ {:name :wait :time 1000 :id "clock"}))]
                       :rules [[(rule {:name :tick :id "clock" :timestamp ts}
                                      (+s (hiccup [:p {:id "time"} (str "time is: " (js/Date. ts))])))]]
                       }))

  (pause clock)
  (unpause clock)
  (-> @clock :kn :old)

  (def incrementer (run-env {:kn #{{:name "counter" :value 0}}
                             :cleanup-rules (concat ui-cleanup-rules timer-cleanup-rules
                                                    [])
                             :tick-rules [(rule {:name :ui/onClick :id "incr-button"}
                                                {:name "counter" :value v}
                                                (= z (inc v))
                                                (> {:name "counter"} {:value z}))]
                             :rules [[(rule {:name "counter" :value v}
                                            (+s (hiccup
                                                 [:p {:id "counter-ui"} v]
