mirror of https://github.com/status-im/reagent.git
Remove helper for shouldComponentUpdate
This commit is contained in:
parent
a66de12cf5
commit
3c6d6cec1d
|
@ -29,8 +29,9 @@
|
|||
(defn set-state [this new-state]
|
||||
(swap! (state-atom this) merge new-state))
|
||||
|
||||
;; set from template, to avoid circular deps
|
||||
(def as-element nil)
|
||||
;; ugly circular dependency
|
||||
(defn as-element [x]
|
||||
(reagent.impl.template/as-element x))
|
||||
|
||||
;;; Rendering
|
||||
|
||||
|
@ -92,7 +93,9 @@
|
|||
(let [old-argv (.' c :props.argv)
|
||||
new-argv (.' nextprops :argv)]
|
||||
(if (nil? f)
|
||||
(not (util/equal-args old-argv new-argv))
|
||||
(or (nil? old-argv)
|
||||
(nil? new-argv)
|
||||
(not= old-argv new-argv))
|
||||
(f c old-argv new-argv))))))
|
||||
|
||||
:componentWillUpdate
|
||||
|
|
|
@ -230,9 +230,6 @@
|
|||
(expand-seq x))
|
||||
true x))
|
||||
|
||||
;; Cheat, to avoid ugly circular dependency
|
||||
(set! reagent.impl.component/as-element as-element)
|
||||
|
||||
(defn expand-seq [s]
|
||||
(let [a (into-array s)]
|
||||
(dotimes [i (alength a)]
|
||||
|
|
|
@ -207,8 +207,3 @@
|
|||
(partial-ifn. callback-fn args nil)
|
||||
false))
|
||||
|
||||
|
||||
;;; Helpers for shouldComponentUpdate
|
||||
|
||||
(defn equal-args [v1 v2]
|
||||
(= v1 v2))
|
||||
|
|
Loading…
Reference in New Issue