 
 ;; --- Delete Project (by id)
 
-(declare dissoc-project)
-
 (defrecord DeleteProject [id]
   rs/WatchEvent
   (-apply-watch [_ state s]

  (Initialize.))

;; --- Projects Fetched

(declare assoc-project)

(defrecord ProjectsFetched [projects]
  rs/UpdateEvent

            [uxbox.util.schema :as sc]
            [uxbox.main.data.pages :as udp]))

;; --- Helpers

(defn assoc-project
  "A reduce function for assoc the project
  to the state map."
  [state proj]
  (let [id (:id proj)]
    (update-in state [:projects-by-id id] merge proj)))

(defn dissoc-project
  "A reduce function for dissoc the project
  from the state map."
  [state id]
  (update-in state [:projects-by-id] dissoc id))

;; --- Initialize

(declare fetch-projects)
(declare projects-fetched?)

(defrecord Initialize []
  rs/UpdateEvent
  (-apply-update [_ state]
    (assoc-in state [:dashboard :section] :dashboard/projects))

  rs/EffectEvent
  (-apply-effect [_ state]
    (when-not (seq (:projects-by-id state))
