This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-09
Channels
- # announcements (20)
- # beginners (115)
- # calva (2)
- # clj-kondo (1)
- # clojure (48)
- # clojure-uk (21)
- # clojurescript (20)
- # css (1)
- # cursive (3)
- # datascript (11)
- # datomic (6)
- # duct (26)
- # emacs (5)
- # funcool (6)
- # off-topic (45)
- # perun (1)
- # precept (4)
- # quil (2)
- # re-frame (1)
- # shadow-cljs (251)
- # tools-deps (27)
- # uncomplicate (9)
I’m new to CLJS and have no JS experience. I started learning CLJ directly.
I’m using Lein and want to add a small JS lib to my project and use the functions included https://raw.githubusercontent.com/arhs/iban.js/master/iban.js
I added this to the cljsbuild
part of my project.clj
:externs ["ext/iban.js"]
:foreign-libs [{:file "ext/iban.js"
:provides ["ibanjs"]}
how do I use the functions now?
I’m trying to replicate this https://codepen.io/kirel/pen/bGNmEjP using reagentI can't really say anything about Lein at this point since I stopped using it quite some time ago. But FWIW (maybe you decide to experiment), it's very simple to use NPM libraries and JS files with shadow-cljs. You just install them or put them within your project and require them. That's it.
@U2FRKM4TW and then (js/isValid)
?
to get the isValid
function, or do I need to access the object first? I installed the package with NPM and required iban
Just require it as ["iban" :refer [isValid]]
and then use the isValid
function as is.
If you want the function to have a better name, you can use ["iban" :rename {isValid isValidIBAN}]
.
This section in particular has the require
convention outlined in a nice table: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
thank you @U2FRKM4TW I’ll try this 😉
Glad you're experimenting! good luck.
i'm thinking ill probably just go with reitit, but would like to know more specifically how it compares to some others
the only ive found, and doesn't have reitit: https://github.com/juxt/bidi#comparison-with-other-routing-libraries
Reitit has a doc that compares it to Bidi: https://github.com/metosin/reitit/blob/master/doc/faq.md
Hey, does anyone know a module that would enable evaluating clojurescript on browser? I am trying to create add clojurescript repl or at least single form evaluation on typescrip/react website.
Not a module, but an open-source app: http://app.klipse.tech/