From 6eb65bfe396c9a5aabddae3a8df7415cae71cd8c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 15 May 2016 23:05:05 +0300 Subject: [PATCH] Move router lense decaration to uxbox.ui ns. --- src/uxbox/router.cljs | 5 ----- src/uxbox/ui.cljs | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/uxbox/router.cljs b/src/uxbox/router.cljs index e35d705a5..87d79030e 100644 --- a/src/uxbox/router.cljs +++ b/src/uxbox/router.cljs @@ -10,17 +10,12 @@ [bidi.bidi :as bidi] [goog.events :as events] [lentes.core :as l] - [uxbox.state :as s] [uxbox.rstore :as rs])) (enable-console-print!) (defonce +router+ (volatile! nil)) -(def route-l - (as-> (l/in [:route]) $ - (l/focus-atom $ s/state))) - ;; --- Update Location (Event) (defrecord UpdateLocation [id params] diff --git a/src/uxbox/ui.cljs b/src/uxbox/ui.cljs index b889c8526..0579d7e5b 100644 --- a/src/uxbox/ui.cljs +++ b/src/uxbox/ui.cljs @@ -30,11 +30,15 @@ (def ^:const +unrestricted+ #{:auth/login}) (def ^:const restricted? (complement +unrestricted+)) +(def route-l + (as-> (l/key :route) $ + (l/focus-atom $ st/state))) + ;; --- Main App (Component) (defn app-render [own] - (let [route (rum/react r/route-l) + (let [route (rum/react route-l) auth (rum/react st/auth-l) location (:id route) params (:params route)]