Skip to content

Commit

Permalink
Calculate flow interceptors earlier than user interceptors
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Jun 26, 2024
1 parent 5bd82b3 commit 0b48cc6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions docs/releases/2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@

> The re-frame [Clojars page](https://clojars.org/re-frame/) contains dependency coordinates for Maven/deps/Lein.
## 1.4.4 (2024-06-24)

#### Changed

- Changed flows to calculate the new app-db earlier in the chain.
- Benefit: user-defined interceptors are aware of the post-flow app-db value.
- Drawback: they can't access the value of app-db directly resulting from the event handler.
- Drawback: they can't access flow-related effects like `:reg-flow`.

- Added a :re-frame/pre-flow-db key to the context
- This way, user-defined interceptors can still access the app-db value resulting directly from the event handler.

## 1.4.3 (2024-01-25)

#### Fixed
Expand Down
12 changes: 6 additions & 6 deletions src/re_frame/alpha.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,10 @@
([id interceptors handler]
(events/register id [cofx/inject-db
fx/do-fx
flow/interceptor
flow/do-fx
std-interceptors/inject-global-interceptors
interceptors
flow/interceptor
flow/do-fx
(db-handler->interceptor handler)])))

(defn reg-event-fx
Expand Down Expand Up @@ -463,10 +463,10 @@
([id interceptors handler]
(events/register id [cofx/inject-db
fx/do-fx
flow/interceptor
flow/do-fx
std-interceptors/inject-global-interceptors
interceptors
flow/interceptor
flow/do-fx
(fx-handler->interceptor handler)])))

(defn reg-event-ctx
Expand Down Expand Up @@ -500,10 +500,10 @@
([id interceptors handler]
(events/register id [cofx/inject-db
fx/do-fx
flow/interceptor
flow/do-fx
std-interceptors/inject-global-interceptors
interceptors
flow/interceptor
flow/do-fx
(ctx-handler->interceptor handler)])))

(defn clear-event
Expand Down

0 comments on commit 0b48cc6

Please sign in to comment.