Fork me on GitHub
#clojurescript
<
2018-11-23
>
olivergeorge05:11:54

Can someone confirm for me which is most idiomatic goog.DEBUG or goog/DEBUG in this context...

(when ^boolean goog.DEBUG (println "Hello world!"))
(when ^boolean goog/DEBUG (println "Hello world!"))

thheller08:11:29

@olivergeorge I'd say goog/DEBUG or js/goog.DEBUG but it really doesn't matter that much. since its a JS variable the compiler doesn't do anything special with it anyways

mfikes13:11:30

@olivergeorge Also, if you want to make your code look correct by first requiring the goog namespace, this wasn't fixed for :advanced until 1.10.312 with CLJS-1677.

hugo19:11:33

I'm having trouble with :advanced after renaming my my namespaces so they start with console. I'm getting TypeError: Cannot read property 'bind' of undefined from the resultant js:

;var sT = lh(new l(null,5,[DN, console.log.bind(console), Nt, console.warn.bind(console), jJ, console.error.bind(console), Hp, n(console.group) ? console.group.bind(console) : console.log.bind(console), tL, n(console.groupEnd) ? console.groupEnd.bind(console) : function() {
        return ke
    }

fabrao20:11:45

Hello all, I´m trying to use PouchDB with re-natal (react-native) app. But the PouchDB is an esModule, so I did (def PouchDB (.-default (js/require "pouchdb-react-native"))). But why after creating (PouchDB. "database") the function names came with '_' before when I log it into debug console? Am I missing something?

dnolen22:11:43

@hybas3 you probably just need to change your namespace name

dnolen22:11:59

namespaces are global

dnolen22:11:09

so you will clash, just don’t do that