File tree 4 files changed +13
-18
lines changed
4 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 6
6
7
7
This project is a fork of [ Re-frame ` v1.4.3 ` ] ( https://github.com/day8/re-frame/tree/v1.4.3 ) where
8
8
the reactivity is implemented using [ Signaali] ( https://github.com/metosin/signaali )
9
- via [ Siagent ] ( https://github.com/metosin/siagent ) instead of [ Reagent] ( https://github.com/reagent-project/reagent ) .
9
+ without [ Reagent] ( https://github.com/reagent-project/reagent ) .
10
10
11
11
It was created:
12
12
- to battle-proof Signaali's API before its release,
@@ -27,7 +27,7 @@ Project status: [experimental](https://github.com/metosin/open-source/blob/main/
27
27
The namespaces were not modified, keep using it as if it was the original Re-frame project.
28
28
29
29
What's different in the library:
30
- - Reagent was replaced by Siagent .
30
+ - Reagent was removed .
31
31
- Some small changes were needed in ` re-frame.interop ` to making it work with Signaali.
32
32
- ` re-frame.interop/after-render ` won't work exactly in the same way, but most apps don't use it.
33
33
@@ -36,12 +36,10 @@ What's different in the library:
36
36
In your ` deps.edn ` , replace the re-frame dependencies with:
37
37
38
38
``` clojure
39
- fi.metosin/si-frame {:mvn/version " 1.4.3.0" }
39
+ fi.metosin/si-frame {:mvn/version " 1.4.3.0-no-siagent " }
40
40
```
41
41
42
- This lib should work for you if:
43
- - All the Reagent features your Reagent components (if any) are using are supported by [ Siagent] ( https://github.com/metosin/siagent ) .
44
- - Your codebase is not directly using the low level implementation of Reagent, e.g. the ` reagent.ratom/RAtom ` type.
42
+ This lib should work for you if you don't use Reagent in your code base.
45
43
46
44
## UIx interop
47
45
Original file line number Diff line number Diff line change 7
7
:scope " provided" }
8
8
org.clojure/clojurescript {:mvn/version " 1.10.844"
9
9
:scope " provided" }
10
- fi.metosin/siagent {:mvn/version " 0.1.0" }
10
+ fi.metosin/signaali {:mvn/version " 0.1.0" }
11
11
net.cgrand/macrovich {:mvn/version " 0.2.1" }
12
12
org.clojure/tools.logging {:mvn/version " 1.1.0" }}
13
13
19
19
:exec-args {:sync-pom true
20
20
:group-id " fi.metosin"
21
21
:artifact-id " si-frame"
22
- :version " 1.4.3.0"
22
+ :version " 1.4.3.0-no-siagent "
23
23
:jar " si-frame.jar" }}
24
24
25
25
; ; clojure -X:deploy
Original file line number Diff line number Diff line change 6
6
[re-frame.loggers :refer [console]]
7
7
[re-frame.interceptor :refer [->interceptor get-effect get-coeffect assoc-effect]]
8
8
[re-frame.interop :as interop]
9
- #?( :cljs [reagent.core :as r]) ))
9
+ [signaali.reactive :as sr] ))
10
10
11
11
(def db-path? vector? )
12
12
94
94
(merge
95
95
{::new? true }
96
96
#?(:cljs
97
- {::ref (r/reaction ( get-in @db/app-db (:path m)))}))))))
97
+ {::ref (sr/create-memo ( fn [] ( get-in @db/app-db (:path m) )))}))))))
98
98
99
99
(defn clear-flow
100
100
([]
Original file line number Diff line number Diff line change 1
1
(ns re-frame.interop
2
2
(:require [goog.async.nextTick]
3
3
[goog.events :as events]
4
- [reagent.core]
5
- [reagent.ratom]
6
4
[signaali.reactive :as sr]))
7
5
8
6
(defn on-load
9
7
[listener]
10
- ; ; events/listen throws an exception in react-native environments because addEventListener is not available.
11
8
(try
12
9
(events/listen js/self " load" listener)
13
10
(catch :default _)))
25
22
(def ^boolean debug-enabled? " @define {boolean}" ^boolean goog /DEBUG )
26
23
27
24
(defn ratom [x]
28
- (reagent.core/atom x ))
25
+ (sr/create-state x { :propagation-filter-fn not=} ))
29
26
30
27
(defn ratom? [x]
31
28
; ; ^:js suppresses externs inference warnings by forcing the compiler to
38
35
(satisfies? IDeref x))
39
36
40
37
(defn make-reaction [f]
41
- (reagent.ratom/make-reaction f ))
38
+ (sr/create-memo f { :propagation-filter-fn not=} ))
42
39
43
40
(defn add-on-dispose! [a-ratom f]
44
- (reagent.ratom /add-on-dispose! a-ratom f))
41
+ (sr /add-on-dispose-callback a-ratom f))
45
42
46
43
(defn dispose! [a-ratom]
47
- (reagent.ratom /dispose! a-ratom))
44
+ (sr /dispose a-ratom))
48
45
49
46
(defn set-timeout! [f ms]
50
47
(js/setTimeout f ms))
72
69
73
70
(defn reactive?
74
71
[]
75
- (reagent.ratom/reactive? ))
72
+ (some? ( sr/get-current-observer ) ))
You can’t perform that action at this time.
0 commit comments