This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-25
Channels
- # announcements (5)
- # babashka (23)
- # beginners (70)
- # cider (24)
- # clj-kondo (14)
- # cljsrn (2)
- # clojars (6)
- # clojure (195)
- # clojure-australia (1)
- # clojure-dev (2)
- # clojure-europe (27)
- # clojure-france (1)
- # clojure-nl (4)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (12)
- # clojurescript (3)
- # clojurewerkz (1)
- # core-async (21)
- # cursive (9)
- # datomic (37)
- # duct (3)
- # emacs (16)
- # events (4)
- # fulcro (34)
- # graalvm (12)
- # javascript (3)
- # jobs (4)
- # malli (1)
- # meander (3)
- # nrepl (1)
- # off-topic (27)
- # pathom (16)
- # re-frame (17)
- # reagent (19)
- # rewrite-clj (18)
- # sci (47)
- # shadow-cljs (179)
- # spacemacs (18)
- # sql (52)
- # tools-deps (80)
- # vim (27)
- # vrac (1)
- # xtdb (9)
i’m assuming headless js is the way to keep a web socket open when my app is in the background, but it looks like headless is moreso triggered by an event. any guidance how to “continue” a web socket from foreground to background?e
this has been driving me nuts. Did anyone encounter this? i am trying to recreate example https://github.com/wuxudong/react-native-charts-wrapper/blob/master/Example/app/LiveUpdateChartScreen.js and this is my component
(defn line-chart []
(let [values (rf/subscribe [:graph/data :line])
colors [(rn/processColor "red") (rn/processColor "blue") (rn/processColor "green") (rn/processColor "yellow") (rn/processColor "purple") (rn/processColor "pink")]]
[:> rn/View {:flex 7}
(prn @values)
[:> charts/LineChart {:style {:flex 1
:background-color :red}
:data (clj->js {:dataSets [{:values @values
:label "A"
:config {:lineWidth 2
:drawValues false
:dashedLine {:lineLength 10
:spaceLength 10
:phase 0}
:color (get colors (rand-int 6))}
}]})
}]])
)
The color of line is updated properly (every 15 sec when @value changes)
but data is not shown on the graph until 4-5 updates pass and then all of sudden all appear
i've inspected props by using refs and those are updated accordingly but rerender doesn't happen
i tried implmenting wrapper similar to https://gist.github.com/jhchabran/e09883c3bc1b703a224d and setState
manually - nothing worked
does anyone have any idea how i could go about this?
I just need to force rerender when @value is updated (which btw is vector of maps with :x and :y)