Fork me on GitHub
#clojurescript
<
2021-04-06
>
introom13:04:28

Hi. What does the :default mean?

p-himik13:04:16

It means a keyword name "default". If you want to learn about why that keyword is there, you need to tell us what exactly that "there" is.

p-himik13:04:22

I.e. we need context.

p-himik13:04:10

If it's in the ns form and the project uses shadow-cljs, then it's explained in this section: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages

introom13:04:16

Thanks. That’s the answer.

bartuka13:04:29

interesting, do I need to define something to make goog.isDefAndNotNull to work? Currently receiving this error from bide

Execution error (TypeError) at (<cljs repl>:1).
goog.isDefAndNotNull is not a function
and if I try to require this function it is not present

bartuka13:04:58

I am using shadow-cljs

p-himik14:04:47

What's "bide"?

p-himik14:04:00

And what's the full stack trace?

bartuka14:04:35

sorry, bide is a routing library https://github.com/funcool/bide and internally it is using goog.isDefAndNotNull call

bartuka14:04:32

this error is the whole

TypeError: goog.isDefAndNotNull is not a function
    at Object.insert (router.js:61)
    at eval (core.cljs:117)
    at eval (core.cljs:5655)
    at eval (core.cljs:5655)
    at Object.eval [as cljs$core$IReduce$_reduce$arity$3] (core.cljs:5659)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (core.cljs:2554)
    at Object.bide$core$router [as router] (core.cljs:116)
    at eval (router.cljs:6)
    at eval (<anonymous>)
    at Object.goog.globalEval (main.js:497)

p-himik14:04:07

Oh wow! We have bidi and bide, and both are routing libraries - not confusing at all. :D But no clue for why you'd see that behavior. If you don't get an answer here, might be worth asking in #shadow-cljs

👍 1
bartuka14:04:34

yeah! thank you!

Jakob Durstberger15:04:55

Does anyone know how I can do something like this with hiccup? <section data-auto-animate> [:section ???]

thheller15:04:07

[:section {:data-auto-animate true}]

👍 1
bastilla15:04:10

Regarding nodejs (respectively, electron), does anyone know how to access global vars? I tried js/... but failed. I'd like to get hold of electron's app (or win object, etc.)

const {app} = require('electron');
app.getPath('home');
but so far, no success. Javascript ppl get this in a heartbeat, so it should be easy with Clojurescript as well, shouldn't it?

bastilla15:04:09

Ok, I just figured out

(defonce home-folder (.-env.HOME (js/require "process")))
gets me the data.

Franco Gasperino21:04:24

Hello - what is the recommended library for http client calls from clojurescript?

Franco Gasperino22:04:49

the advantage over using JS interop instead of something akin to cljs-http?

athomasoriginal22:04:32

Native api, no deps, aligning with current "best practices", possibly less code because your using only what you need.

yes 2