Extract out subscriptions

This commit is contained in:
Daniel Compton 2017-11-13 16:22:43 +13:00
parent 1c456acaae
commit dabd165295
1 changed files with 27 additions and 7 deletions

View File

@ -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