Remove replace-args

Probably not very useful, and easy to add back if need be
This commit is contained in:
Dan Holmsand 2014-02-10 09:31:25 +01:00
parent e76d81f16a
commit 16a41f67e4
3 changed files with 2 additions and 22 deletions

View File

@ -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*)

View File

@ -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

View File

@ -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