diff --git a/docs/releases/2023.md b/docs/releases/2023.md index 85c0527d1..da5cb0461 100644 --- a/docs/releases/2023.md +++ b/docs/releases/2023.md @@ -10,6 +10,6 @@ > Committed but unreleased changes are put here, at the top. Older releases are detailed chronologically below. -#### Breaking - +#### Breaking + - `re-frame.std-interceptors/path` now keeps a `:re-frame.db/path-history` key in the context, not a `:re-frame-path/db-store` key. This shouldn't affect users, unless you're directly hacking the event loop. - [763](https://github.com/day8/re-frame/pull/763) on detecting an incorrect event structure, the `unwrap` interceptor now exceptions instead of writing an error to `js/console` and continuing. diff --git a/src/re_frame/std_interceptors.cljc b/src/re_frame/std_interceptors.cljc index 1897dd4cf..da943332c 100644 --- a/src/re_frame/std_interceptors.cljc +++ b/src/re_frame/std_interceptors.cljc @@ -166,7 +166,7 @@ (defn path [& args] (let [path (flatten args) - db-store-key :re-frame-path/db-store] ;; this is where, within `context`, we store the original dbs + history-key :re-frame.db/path-history] ;; this is where, within `context`, we store the original dbs (when (empty? path) (console :error "re-frame: \"path\" interceptor given no params")) (->interceptor @@ -175,13 +175,13 @@ [context] (let [original-db (get-coeffect context :db)] (-> context - (update db-store-key conj original-db) + (update history-key conj original-db) (assoc-coeffect :db (get-in original-db path))))) :after (fn [context] - (let [db-store (db-store-key context) + (let [db-store (history-key context) original-db (peek db-store) new-db-store (pop db-store) - context' (-> (assoc context db-store-key new-db-store) + context' (-> (assoc context history-key new-db-store) (assoc-coeffect :db original-db)) ;; put the original db back so that things like debug work later on db (get-effect context :db ::not-found)] (if (= db ::not-found)