add note about not being able to use collected? inline in a path when using cljs, disable that test for cljs

This commit is contained in:
Nathan Marz 2016-06-13 15:26:08 -04:00
parent 1697938587
commit c82c3b71d8
2 changed files with 9 additions and 1 deletions

View file

@ -624,7 +624,11 @@
"Creates a filter function navigator that takes in all the collected values
as input. For arguments, can use `(collected? [a b] ...)` syntax to look
at each collected value as individual arguments, or `(collected? v ...)` syntax
to capture all the collected values as a single vector."
to capture all the collected values as a single vector.
For ClojureScript, since can't use macros inside path when that path will be
inline factored/cached, to use collected? declare the logic in a global
variable such as (def my-collected (collected? [v] (= v 1)))"
[params & body]
`(i/collected?* (fn [~params] ~@body))
)

View file

@ -1224,6 +1224,10 @@
m)
)))
;; clojure only because inability to use macroexpand inside path macro in
;; clojurescript makes it impossible to use macros inside the path
#+clj
(deftest collected?-test
(let [data {:active-id 1 :items [{:id 1 :name "a"} {:id 2 :name "b"}]}]
(is (= {:id 1 :name "a"}