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:
parent
1697938587
commit
c82c3b71d8
2 changed files with 9 additions and 1 deletions
|
|
@ -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))
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
|
|
|
|||
Loading…
Reference in a new issue