 (defn identity-token []
   (.getItem (.-localStorage js/window) "rmfu-feed-identity-token"))
 
+(def app-state (reagent/atom
+          {:alert                    {:display false
+                                      :message nil
+                                      :title   nil}}))
+
+(defn alert-update-display-fn [title msg]
+          (swap! app-state assoc
+          :alert {:title   title
+                  :message msg
+                  :display true}))
+
 (defn nav
   "Renders basic nav with an .active link"
   [active]

  (:require [secretary.core :as secretary :include-macros true]
            [reagent.core :as reagent]
            [ajax.core :refer [GET]]
            [reagent.session :as session]))

(defn logout

                 [:a.nav-link.active {:href "/#/admin"} "Admin"]])]
             [:form.form-inline.navbar-form.pull-right
              [:button.btn.btn-success-outline {:type "button" :on-click #(logout)} "logout"]]]
            [:a.navbar-brand.feed-title {:href "/"} "FEED"])]
         [:div [alert :error app-state 5000]]]
         )})))
