Skip to content

Please export public API for javascript interop using ^:export #58

Description

@kristianmandrup

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions