fix(compile): fix warnings

This commit is contained in:
defclass
2021-04-29 21:55:52 +08:00
parent 14638ff6b9
commit 7063a6649e

View File

@@ -1,13 +1,14 @@
(ns frontend.react-impls
"Support different react implements.")
"Support different react implements."
(:require [rum.core]))
;; Remove rum *reactions* assert
(defn rum-react
"Works in conjunction with [[reactive]] mixin. Use this function instead of `deref` inside render, and your component will subscribe to changes happening to the derefed atom."
[ref]
(when rum.core/*reactions*
(vswap! rum.core/*reactions* conj ref))
(when (deref #'rum.core/*reactions*)
(vswap! (deref #'rum.core/*reactions*) conj ref))
(and ref @ref))
(def react (atom rum-react))