Skip to content

Commit

Permalink
Fix interop issues
Browse files Browse the repository at this point in the history
Re-frame.utils was failing to import in a clj repl, since clj doesn't
support #queue [].

Fixed that, as well as some other potential compatibility problems.
  • Loading branch information
kimo-k committed Dec 9, 2023
1 parent 1d81f23 commit d001d76
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/releases/2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

> The re-frame [Clojars page](https://clojars.org/re-frame/) contains dependency coordinates for Maven/deps/Lein.
## 1.4.2 (2023-12-09)

#### Fixed

- `re-frame.utils` failed to load in a clj runtime, due to interop issues.

## 1.4.1 (2023-12-07)

#### Added
Expand Down
3 changes: 2 additions & 1 deletion src/re_frame/flow/alpha.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[re-frame.registrar :refer [get-handler]]
[re-frame.loggers :refer [console]]
[re-frame.interceptor :refer [->interceptor get-effect get-coeffect update-effect assoc-effect]]
[re-frame.interop :as interop]
[reagent.core :as r]))

(def db-path? vector?)
Expand All @@ -13,7 +14,7 @@

(def flow<-? (comp some? ::flow<-))

(def flows (r/atom {}))
(def flows (interop/ratom {}))

(defn lookup [id] (get @flows id))

Expand Down
4 changes: 2 additions & 2 deletions src/re_frame/subs/alpha.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[re-frame.subs :refer [deref-input-signals sugar warn-when-not-reactive]]
[re-frame.registrar :refer [register-handler]]
[re-frame.register.alpha :refer [reg lifecycle->method]]
[re-frame.interop :refer [add-on-dispose! make-reaction reactive? reagent-id]]
[re-frame.interop :refer [add-on-dispose! make-reaction reactive? reagent-id ratom]]
[re-frame.query.alpha :as q]
[re-frame :as-alias rf]
[re-frame.trace :as trace :include-macros true]
Expand Down Expand Up @@ -102,7 +102,7 @@

(reg :sub-lifecycle :forever sub-forever)

(def nil-ref (r/atom nil))
(def nil-ref (ratom nil))

(defn sub-flow [q]
(or (some-> (:id (or (second (::rf/query-v q)) q))
Expand Down
5 changes: 3 additions & 2 deletions src/re_frame/utils.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns re-frame.utils
(:require
[re-frame.loggers :refer [console]]))
[re-frame.loggers :refer [console]]
[re-frame.interop :as interop]))

(defn dissoc-in
"Dissociates an entry from a nested associative structure returning a new
Expand Down Expand Up @@ -53,7 +54,7 @@
{} graph)
ks (keys graph)]
(loop [q (filter #(zero? (get in-degree % 0)) ks)
sorted #queue []
sorted interop/empty-queue
in-degree in-degree]
(cond
(seq q)
Expand Down
File renamed without changes.

0 comments on commit d001d76

Please sign in to comment.