sanity
sanity copied to clipboard
Please export public API for javascript interop using ^:export
I would love somehow to use Comportex or Sanity from Javascript more directly.
Looking through the code base, I see it used in the examples via reagent/render:
(defn ^:export init
[]
(reagent/render [main/sanity-app "Comportex" [model-tab] [world-pane]
all-features into-sim]
(dom/getElement "sanity-app"))
(swap! main/viz-options assoc-in [:drawing :display-mode] :two-d)
(put! into-sim ["run"]))
Would it make sense for main/sanity-app and such key API methods to be exported and made accessible from JS? or would it require a dedicated port to JS for React or similar reactive UI framework?
(defn ^:export sanity-app
[title model-tab world-pane features into-sim]
(main/sanity-app title model-tab world-pane features into-sim))