Additional polish and fixes

- fix two bugs with subs - didn't have global config and missing merge
- explicit re-watch for global config
- more docs
This commit is contained in:
Gabriel Horner
2022-09-05 17:13:00 -04:00
committed by Andelf
parent b1d210d26b
commit 7ade955df7
12 changed files with 47 additions and 31 deletions

View File

@@ -299,7 +299,8 @@
configs))
(defn get-config
"User config for the given repo or current repo if none given"
"User config for the given repo or current repo if none given. All config fetching
should be done through this fn in order to get global config and config defaults"
([]
(get-config (get-current-repo)))
([repo-url]
@@ -499,11 +500,13 @@ Similar to re-frame subscriptions"
(util/react (rum/cursor state ks))))
(defn sub-config
"Sub equivalent to get-config"
"Sub equivalent to get-config which should handle all sub user-config access"
([] (sub-config (get-current-repo)))
([repo]
(let [config (sub :config)]
(merge (get config ::global-config) (get config repo)))))
(merge-configs default-config
(get config ::global-config)
(get config repo)))))
(defn enable-grammarly?
[]