omcljs / om

ClojureScript interface to Facebook's React
6.66k stars 362 forks source link

db->tree recursion edge case #877

Open bnoguchi opened 7 years ago

bnoguchi commented 7 years ago

In JVM clojure, the following will fail:

(let [query [{:tree [:id
                         :value
                         {:children '...}]}]
          state {:tree {:id 0 :value 42
                        :children [{:id 1 :value 43
                                    :children [{:id 2 :value 99
                                                :children []}]}
                                   {:id 3 :value 101
                                    :children []}]}}]
      (is (= state
             (om/db->tree query state state))))

with exception

java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol