Fork me on GitHub
#clojurescript
<
2017-04-01
>
mikethompson01:04:51

No wait. Ignore that. Sorry, i got the wrong end of your question.

mikethompson01:04:16

Yes, you could do something like your suggestion. But that won't be a part of re-frame itself. it will be your layer over the top. Note: there is a #reframe channel which might be a better place to take this.

rb171909:04:49

What is the best way to slurp a website using just CLJS? I came across https://gist.github.com/noprompt/9086232 but it uses a clojure macro. Is it possible to slurp a website without using any clojure, just clojurescript, as I want my reframe app to be pure CLJS?

fernandohur10:04:28

If I want to tell if a value is a string I use string?. Is there something analogous to tell if a value is an atom?

qqq10:04:42

Isn't there atom?

fernandohur10:04:29

Unfortunately not.

fernandohur10:04:14

I also tried (isa? x IDeref), but it doesn’t work.

qqq10:04:34

(instance? clojure.lang.Atom x)

qqq10:04:12

I'm now curious why there is no atom? -- seems like a useful function.

fernandohur10:04:19

clojure.lang.Atom is not part of Clojurescript, or is it?

fernandohur10:04:34

cljs.user=> (satisfies? IDeref (atom 1))
true
cljs.user=> (satisfies? IDeref 1)
false
Looks like this will work.

qqq10:04:13

I think there are other things that can be IDeref -ed

qqq10:04:19

promises/futures, or something like that

fernandohur10:04:04

Is it also the case in cljs?

fernandohur10:04:34

You are right, I guess anything that implements that protocol.

credmp11:04:47

@mikethompson yea, I will ask them there… I have not been able to wrap it properly… almost to the point of resorting to a macro 😉

thheller11:04:18

@credmp (fn [x] (:foo x)) can be shortened to just :foo as keywords are also ifn? themselves

credmp11:04:03

sure, that is very true, but the re-frame framework uses this setup, the fn is called from the context

credmp11:04:12

but it is quite redundant for the simple cases

credmp11:04:37

because you will always create an fn that just returns the key that you use as a subscription key

credmp11:04:43

in my experience

thheller11:04:43

(re-frame/reg-sub :board :board)

credmp11:04:57

I never tried that

credmp11:04:09

that would already be awesome

thheller11:04:21

no idea if that works, maybe re-frame only accepts fn? and not ifn?

credmp11:04:29

let me check

credmp11:04:46

well damn.. that works

newres13:04:36

what is a solid clojure framework to start coding an SPA at the moment? I know some clojure and and some react/redux. Is the re-frame a good place to start?

credmp13:04:56

thats what I use, it is really great

credmp13:04:09

be sure to read the readme though 🙂

newres13:04:44

I tried to, I am not sure i get it yet but I guess I will learn by failiing a bit

credmp13:04:53

yes, the concepts can take some time to get your head around

credmp13:04:57

but well worth it

newres14:04:19

is there some other docs out for it?

selfsame14:04:57

@rb1719 you'd have to use ajax with resources accessible under CORS

sineer14:04:08

@rb1719 (:require [ajax.core :refer [GET]]) ...