mirror of
https://github.com/status-im/reagent.git
synced 2025-01-12 12:54:50 +00:00
Remove replace-args
Probably not very useful, and easy to add back if need be
This commit is contained in:
parent
e76d81f16a
commit
16a41f67e4
@ -56,10 +56,6 @@ Everything is optional, except :render.
|
|||||||
(comp/create-class spec))
|
(comp/create-class spec))
|
||||||
|
|
||||||
|
|
||||||
(defn replace-args [comp new-args]
|
|
||||||
(assert (vector? new-args))
|
|
||||||
(comp/set-args comp new-args))
|
|
||||||
|
|
||||||
(defn current-component []
|
(defn current-component []
|
||||||
comp/*current-component*)
|
comp/*current-component*)
|
||||||
|
|
||||||
|
@ -49,11 +49,6 @@
|
|||||||
(defn get-children [C]
|
(defn get-children [C]
|
||||||
(-> C get-argv extract-children))
|
(-> C get-argv extract-children))
|
||||||
|
|
||||||
(defn set-args [C new-args]
|
|
||||||
(let [argv (get-argv C)]
|
|
||||||
(.setProps C (js-obj cljs-argv
|
|
||||||
(into [(argv 0)] new-args)))))
|
|
||||||
|
|
||||||
|
|
||||||
;;; Rendering
|
;;; Rendering
|
||||||
|
|
||||||
|
@ -62,19 +62,8 @@
|
|||||||
(with-mounted-component (comp {:foo "you"})
|
(with-mounted-component (comp {:foo "you"})
|
||||||
(fn [C div]
|
(fn [C div]
|
||||||
(swap! ran inc)
|
(swap! ran inc)
|
||||||
(is (found-in #"hi you" div))
|
(is (found-in #"hi you" div))))
|
||||||
|
(is (= 3 @ran)))))
|
||||||
(reagent/replace-args C [{:foo "there"}])
|
|
||||||
(is (found-in #"hi there" div))
|
|
||||||
|
|
||||||
(let [runs @ran]
|
|
||||||
(reagent/replace-args C [{:foo "there"}])
|
|
||||||
(is (found-in #"hi there" div))
|
|
||||||
(is (= runs @ran)))
|
|
||||||
|
|
||||||
(reagent/replace-args C [{:foobar "not used"}])
|
|
||||||
(is (found-in #"hi ." div))))
|
|
||||||
(is (= 5 @ran)))))
|
|
||||||
|
|
||||||
(deftest test-state-change
|
(deftest test-state-change
|
||||||
(when isClient
|
(when isClient
|
||||||
|
Loading…
x
Reference in New Issue
Block a user