From a11414aa80b318078356da7cf8d9d57eb986c587 Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Mon, 26 Jun 2023 14:06:03 +0200 Subject: [PATCH] [feature] Describe the :path interceptor's path with a comment --- docs/releases/2023.md | 4 ++++ src/re_frame/std_interceptors.cljc | 1 + 2 files changed, 5 insertions(+) diff --git a/docs/releases/2023.md b/docs/releases/2023.md index da5cb0461..6cb47a554 100644 --- a/docs/releases/2023.md +++ b/docs/releases/2023.md @@ -13,3 +13,7 @@ #### 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. + +#### Added + - Interceptors now have an optional `:comment` key. It's a no-op. + - `re-frame.std-interceptors/path` now remembers the path it uses in a `:comment`. ((re-frame-10x#165)[https://github.com/day8/re-frame-10x/issues/165]) diff --git a/src/re_frame/std_interceptors.cljc b/src/re_frame/std_interceptors.cljc index 28d70e09c..dd22455e6 100644 --- a/src/re_frame/std_interceptors.cljc +++ b/src/re_frame/std_interceptors.cljc @@ -171,6 +171,7 @@ (console :error "re-frame: \"path\" interceptor given no params")) (->interceptor :id :path + :comment {::app-db/path path} :before (fn [context] (let [original-db (get-coeffect context :db)]