diff --git a/src/day8/re_frame/trace/subs.cljs b/src/day8/re_frame/trace/subs.cljs index ec1daf1..b1c7e39 100644 --- a/src/day8/re_frame/trace/subs.cljs +++ b/src/day8/re_frame/trace/subs.cljs @@ -2,24 +2,44 @@ (:require [mranderson047.re-frame.v0v10v2.re-frame.core :as rf])) (rf/reg-sub - :settings/panel-width% + :settings/root (fn [db _] - (get-in db [:settings :panel-width%]))) + (get db :settings))) + +(rf/reg-sub + :settings/panel-width% + :<- [:settings/root] + (fn [settings _] + (get settings :panel-width%))) (rf/reg-sub :settings/show-panel? - (fn [db _] - (get-in db [:settings :show-panel?]))) + :<- [:settings/root] + (fn [settings _] + (get settings :show-panel?))) (rf/reg-sub :settings/selected-tab + :<- [:settings/root] + (fn [settings _] + (get settings :selected-tab))) + +(rf/reg-sub + :app-db/root (fn [db _] - (get-in db [:settings :selected-tab]))) + (get db :app-db))) (rf/reg-sub :app-db/paths - (fn [db _] - (get-in db [:app-db :paths]))) + :<- [:app-db/root] + (fn [app-db-settings _] + (get app-db-settings :paths))) + +(rf/reg-sub + :app-db/search-string + :<- [:app-db/root] + (fn [app-db-settings _] + (get app-db-settings :search-string))) (rf/reg-sub :traces/filter-items