Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some translation bugs. ## Passing edges as a prop to Reagent-flow component It should be possible to pass a kebab-cased list of edges from Clojure to reagent-flow, and the latter should be in charge of making any translations needed. Currently, this works fine unless the edge maps employ handles, the expected translation should be: Expected: (CLJS) :source-handle -> (JS) sourceHandle Currently: Simple Clojure to JS translation (clj-js function). No casing translation. ### Solution Use the clj->flowjs function to translate the list of edges. {:edges (clj->flowjs (:edges params))} ## Translation back to ClojureScript When translating lists back to Clojure, the flowjs->clj function doesn't carry out any translation if the argument passed is a vector. This is because Seq? only returns true if the parameter is a Clojure list. However, the translation from JS arrays to Clojure is in the form of Vectors, therefore when a vector is passed to seq? it returns false. ## Case translation to JS React-flow React-flow uses camel casing for the list of nodes and edges. However, the case translation employed by reagent flow right now is to snake_case, which causes React-flow to not work as intended.
- Loading branch information