Fork me on GitHub
#clojurescript
<
2020-07-27
>
jeroenvandijk11:07:14

Anyone familiar with a clojurescript library that wraps or mimicks requirejs? I want to dynamically load npm libraries in my clojurescript app

gekkostate18:07:59

Hi all, quick question. Does anyone recommend a specific approach to checking if the user is accessing the website from mobile or not?

phronmophobic18:07:56

mobile is a general category that is compromised of a set of features. typically, different parts of your code don't care if the browser is viewed from a mobile device, but care about specific features. in other words, you should probably check for: • screen size • detection for specific APIs (eg. non mobile devices can also have touch inputs)

👍 3
phronmophobic18:07:13

caveat emptor: unless you're using doing user agent sniffing for analytics or similar, then doing user agent sniffing instead of feature detection is likely to cause future headaches

gekkostate18:07:04

Interesting @U7RJTCH6J. I think I will check for device width + touch gestures.

gekkostate18:07:38

@U08JKUHA9 I have heard that checking for user agent is not the best because it varies constantly.

✔️ 3
theequalizer7318:07:47

Hi Folks, how can I write this on ClojureScript?

function colorize() {
      document.getElementById("val").style.color = 'green';
    }

isak18:07:43

(defn colorize []
  (set! (.. (js/document.getElementById "val") 
         -style -color)
     "green"))

sharkdance 3
3
rberger05:07:55

https://roman01la.github.io/javascript-to-clojurescript/ is an amazing help figuring out how to translate snippets like that

😮 3
theequalizer7316:07:40

Amazing! This will help me a lot! Thank you!

💯 3
sova-soars-the-sora22:07:18

Hello, I want to include rum/defc components from a cljc file. how can i "refer" to the components from cljs?

sova-soars-the-sora23:07:03

it has macros, it seems like (load-file is the way)

sova-soars-the-sora23:07:23

nevermind, that's repl only