This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-04
Channels
- # announcements (9)
- # bangalore-clj (1)
- # beginners (164)
- # calva (7)
- # clj-kondo (12)
- # cljs-dev (5)
- # cljsrn (7)
- # clojure (100)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (9)
- # conjure (22)
- # datomic (53)
- # fulcro (62)
- # graalvm (27)
- # helix (10)
- # joker (6)
- # malli (1)
- # mount (4)
- # nrepl (3)
- # off-topic (8)
- # quil (1)
- # releases (1)
- # sci (42)
- # shadow-cljs (1)
- # testing (7)
- # tools-deps (26)
- # vim (24)
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.
apparently yes: https://clojurescript.org/guides/faq-js#can-i-call-javascript-from-clojurescript
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”
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.
Datascipt is a beautiful project, thanks for you help.
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
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?