This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-21
Channels
- # aatree (88)
- # admin-announcements (14)
- # alda (26)
- # announcements (4)
- # avi (6)
- # aws (7)
- # beginners (80)
- # boot (268)
- # braid-chat (58)
- # cider (4)
- # clara (54)
- # cljs-dev (16)
- # cljsrn (27)
- # clojars (13)
- # clojure (123)
- # clojure-chicago (2)
- # clojure-czech (8)
- # clojure-france (5)
- # clojure-hamburg (2)
- # clojure-miami (6)
- # clojure-nl (5)
- # clojure-russia (285)
- # clojure-spain (2)
- # clojurebridge (3)
- # clojurescript (137)
- # code-reviews (14)
- # community-development (6)
- # core-async (8)
- # core-matrix (10)
- # cursive (2)
- # datascript (1)
- # datomic (24)
- # dirac (2)
- # emacs (5)
- # hoplon (4)
- # incanter (6)
- # jobs (7)
- # ldnclj (42)
- # ldnproclodo (2)
- # leiningen (1)
- # mount (60)
- # off-topic (15)
- # om (134)
- # onyx (65)
- # perun (4)
- # portland-or (2)
- # proton (15)
- # random (1)
- # re-frame (24)
- # reagent (7)
- # testing (4)
- # yada (9)
More specific code is here: https://github.com/sooheon/tomaton/blob/master/src/cljs/tomaton/components/user.cljs#L20
@peterbak @colin.yates : In https://github.com/yatesco/re-frame-stiching-together/blob/2d4363b31da630ac170035ec215c0164bf874a4d/src/cljs/demo/views.cljs#L151 won't the subscriptions be re-done on each change to the temperatures
or id->fruit
ratom? They are derefed outside of the final reaction that is the result of the subscription function. Or maybe I still don't understand how reactions work.
@sooheon: your link do not work
@sooheon: how are you calling panels when the url changes?
see this as an example https://github.com/madvas/fractalify/blob/master/src/cljs/fractalify/router.cljs
@hugobessaa: Hey thank you, I realised that my problem was using a form-2 function without also sending the argument to the inner function. In the fractalify codebase, actually it seems that he sent the args to just the inner fn, while re-frame docs recommend supplying to both. Both ways seem to work in my app—is there a practical difference?
AFAIK you need to keep them with the same arity
Actually I don't think they need to be the same arity. The "outer function" just holds the initial values, and the inner render function will hold the values that are updated by react
That's why if you forget to repeat the arguments, the component will never seem to update
I guess if you don't define the parameters for the outer function, the component just won't get any initial values? No reason to really do that though
As far as I understand that means that the subscribe code is executed each time the component is re-rendered, instead of just using the reactions these subscriptions return. However I don't know how big a performance impact that really is.
subscribe
returns a ratom
. You will want to subscribe once and let reagent do it's magic to just render your components when that ratom
value changes. See https://github.com/reagent-project/reagent#examples. It superficially explains how form-2 works
Om.next is the closest thing to that. I've also remember dato and posh in that general niche. I'm also doing something like that, but not in the open ATM.
i am also writing a solution but my gut tells me that i am reinventing the wheel at numerous places
Hmm, yeah, it seems posh is only client-side indeed. Om.next is ATM the most advanced solution. I recall the maintainer mentioning that the synchronisation part can be used separately from the DOM part, but I didn't yet have any time to look into that.
@shaym I’ve done that using http://firebase.com as the backend data store and kept it in sync with a local ratom. Worked pretty well for building some basic multiplayer (2-6 player) turn based games