 ;; {:repos - :auth -}
 (defn repo-detail-view [state owner]
   (reify
-    om/IInitState
-    (init-state [_]
-      state)
-
-    om/IRenderState
-    (render-state [this state]  
+    om/IRender
+    (render [this]  
       (let [current-index (nth (om/observe owner (current-index-cur)) 0)
-            repos (:repos state)]    
+            repos (:repos @app-state)]
         (if (< current-index (count repos))
           (om/build repo-config-panel {:repo (nth repos current-index) 
                                        :auth (:auth state)})                              


(enable-console-print!)

(def app-state (atom {:current-index [0]}))

(defn current-index-cur []
  (om/ref-cursor (:current-index (om/root-cursor app-state))))

(defn- repo-button [index repo]
  (dom/button 
    #js {:onClick
           (fn [e] (om/update! (current-index-cur) [0] index))}
    (get repo "full_name")))

(defn repo-list-view [state owner]
  (reify
    om/IRender
    (render [this]
      (apply dom/div nil
        (map-indexed repo-button state)))))  

;; {:auth - :repo -}
(defn repo-config-panel [state owner]

        (merge state {:mutable mutable
                      :state-cursor (:state (om/root-cursor mutable))})))   

    om/IWillMount
    (will-mount [_]
      (prn "repo panel mount"))

    om/IRenderState
    (render-state [this state]
      (prn "repo panel render")

      (let [cursor (om/ref-cursor (:state-cursor state))   
            current-state (nth (om/observe owner cursor) 0)
            auth-token (:auth state)
