 (ns clj-money.views.imports
   (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [reagent.core :as r]
+            [reagent.ratom :refer [make-reaction]]
             [secretary.core :as secretary :include-macros true]
             [cljs.core.async :refer [timeout
                                      <!]]

(declare load-import)
(defn- receive-import
  [{{:keys [errors finished]} :progress :as received} page-state]
  (swap! page-state #(-> %
                         -busy
                         (assoc :active received)))
  (when (seq errors)
    (trace {:errors errors}))
  (when finished


(defn- load-import
  [page-state]
  (imports/get (get-in @page-state [:active :id])
               #(receive-import % page-state)
               (notify/danger-fn "Unable to load the import: %s")))

(defn- start-import
  [imp page-state]
