Fork me on GitHub
#clojurescript
<
2020-07-04
>
madeinquant01:07:40

Is it possible to call cljs from js in javascript project? If it is possible, it may be able to apply architectural patterns in React Native use MVVM/MVC.  View modules are represented in javascript, internal mechanisms are represented in cljs.

madeinquant02:07:51

Thanks for your reply. I would call cljs from js. There is an example, if the example can be replaced with cljs, that would be perfect “https://dev.to/yakimych/adding-reasonml-to-an-existing-codebase-part-1-3kkg

ksd02:07:23

I have 0 experience with cljs and am relatively new to clojure, but the last line of the section I sent you says “You can also write functions in ClojureScript and call them from JavaScript.” It doesn’t specify how though.

madeinquant02:07:33

Datascipt is a beautiful project, thanks for you help.

ksd03:07:28

no worries 🙂

nenadalm05:07:57

if symbol is exported in cljs, it can then be called from js using global variables: https://clojurescript.org/reference/advanced-compilation#access-from-javascript In case of using shadow-cljs to compile cljs, import in js can be used (no export needed): https://shadow-cljs.github.io/docs/UsersGuide.html#_access_cljs_from_js

Jacob Emcken02:07:04

I'm used to a workflow form Clojure where I edit my namespace and then the use C-c C-c in Emacs to "Eval top form". I'm looking for something similar for ClojureScript frontend development where I can pin point what I want re-evaluated without having to save the file. Is that possible?