Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kristianmandrup opened this issue Aug 10, 2016 · 0 comments
Open

Comments

@kristianmandrup
Copy link

kristianmandrup commented Aug 10, 2016

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant