mirror of https://github.com/status-im/reagent.git
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))
|
||||
|
||||
|
||||
(defn replace-args [comp new-args]
|
||||
(assert (vector? new-args))
|
||||
(comp/set-args comp new-args))
|
||||
|
||||
(defn current-component []
|
||||
comp/*current-component*)
|
||||
|
||||
|
|
|
@ -49,11 +49,6 @@
|
|||
(defn get-children [C]
|
||||
(-> 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
|
||||
|
||||
|
|
|
@ -62,19 +62,8 @@
|
|||
(with-mounted-component (comp {:foo "you"})
|
||||
(fn [C div]
|
||||
(swap! ran inc)
|
||||
(is (found-in #"hi you" div))
|
||||
|
||||
(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)))))
|
||||
(is (found-in #"hi you" div))))
|
||||
(is (= 3 @ran)))))
|
||||
|
||||
(deftest test-state-change
|
||||
(when isClient
|
||||
|
|
Loading…
Reference in New Issue