This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-18
Channels
- # beginners (123)
- # boot (3)
- # cider (6)
- # clara (1)
- # cljs-dev (139)
- # cljsrn (9)
- # clojure (59)
- # clojure-italy (5)
- # clojure-uk (41)
- # clojured (10)
- # clojurescript (67)
- # community-development (1)
- # component (2)
- # core-async (7)
- # cursive (4)
- # datomic (4)
- # defnpodcast (2)
- # fulcro (23)
- # graphql (1)
- # jobs (2)
- # leiningen (4)
- # off-topic (32)
- # portkey (7)
- # protorepl (5)
- # re-frame (19)
- # reagent (5)
- # reitit (23)
- # shadow-cljs (29)
- # slack-help (1)
- # spacemacs (1)
- # tools-deps (21)
- # unrepl (18)
Yeah, you might want to be careful about how you measure it, certain properties that you touch on the DOM cause a full reflow, not sure whether screen width is one of them or not
I’m trying to integrate a WS callback using sente and there don’t seem to be any good examples of the prior art
is it better to use a subscription within a subscription or just access the same keys as the other subscription?
a subscription within a subscription sounds nice because changes to the map would only need to be updated in one subscription. but im not sure if this would cause any issues
@raymcdermott I googled for "sente re-frame" and got a few hits
(reg-event-db ::eval-result (fn [db [_ eval-result]] (let [eval-results (or (:eval-results db) [])] (assoc db :eval-results (conj eval-results eval-result))))) (reg-fx ::send-eval (fn [{:keys [form-to-eval timeout]}] (when-not (str/blank? form-to-eval) (chsk-send! [:example/repl {:form form-to-eval}] (or timeout 3000) (fn [eval-result] (re-frame/dispatch [::eval-result eval-result])))))) (reg-event-fx ::eval (fn [cofx [_ form-to-eval]] {:db (assoc (:db cofx) :form-to-eval form-to-eval :eval-result nil) ::send-eval {:form-to-eval form-to-eval}}))
most of the ones that I saw always start on the server so are not as ‘pure’ client side as I want
Are you saying there are no effects handlers among them?
Hmm. I see what you are saying. No effects handlers. odd. And a tighter Gihub search doesn't do better: https://github.com/search?utf8=%E2%9C%93&q=sente+re-frame+&type=
@atticmaverick generally you'd use layered subscriptions because the "layer 3" does some CPU intensive computation and you want a layer 2 to just do an extraction from app-db
and prune the propagation to layer 3 when there's been no change to the inputs.
Accessing map keys is not a very CPU intensive process generally. So, normally, I wouldn't bother.
@mikethompson Thanks. That's kind of what i gathered from testing it. It seemed to work fine. I will look into the layered subscription so I can have a better understanding.
Perfect! That documentation is amazing. So easy to understand. Thanks again!