                ctrl))
       ;; no more elements to render
       [rendering rendered seen ctrl])))
+
+
+(defn register-ratoms-map [ratoms-map ratoms component]
+  (reduce (fn [rmap ratom]
+            (when (contains? ratoms-map ratom)
+              (throw (ex-info "Reactive atom has already a dependent parent component" {:ratom ratom
+                                                                                        :parent-component (get ratoms-map ratom)
+                                                                                        :child-component component})))
+            (assoc rmap ratom component)) ratoms-map ratoms))
+
+(defn unregister-ratoms-map [ratoms-map component]
+  (reduce (fn [rmap [ratom comp]]
+            (if (= comp component)
+              rmap
+              (assoc rmap ratom comp))) {} ratoms-map))
+
+
+
 ;;{
 ;; The main rendering function follows.
 ;;}

;; just reuse its previous value.
;;}

;; CONTROLLER
;; ----------
;; Will be inside the the universe

;; (defn make-controller []
;;   (atom {:components {}}))

;; XXX: nested #(...) are not allowed ...
;; (defn register-component! [controller component]
;;   (swap! controller #(update % :components #(assoc % component {}))))

(defn register-component! [controller component]
  (swap! controller #(update % :components (fn [comps] (assoc comps component {})))))

(defn unregister-component! [controller component]

                       (dissoc comps component)
                       (throw (ex-info "No such component in controller" {:controller ctrl
                                                                          :component component}))))))))


;;{
;; ## Renderer
;;
;; The component renderer takes a possibly partially
