This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-01
Channels
- # announcements (1)
- # babashka (1)
- # beginners (45)
- # business (3)
- # calva (43)
- # clojure (57)
- # clojure-spec (6)
- # clojure-uk (4)
- # clojured (8)
- # clojurescript (14)
- # cryogen (3)
- # datomic (2)
- # emacs (36)
- # fulcro (20)
- # garden (2)
- # jobs (2)
- # lumo (3)
- # meander (9)
- # off-topic (1)
- # other-lisps (1)
- # reagent (13)
- # shadow-cljs (25)
- # spacemacs (20)
- # tools-deps (11)
Hi everyone,
i'm trying to use chart.js but i have a problem in the delay of viewing the data, i'm using re-frame and i'm using that code:
Hi, i think you don't need the fn partt here
(defn x-chart []
(let [chart-labels (rf/subscribe [:x/x-labels])
chart-data (rf/subscribe [:x/x-data])]
(fn []
[gen-x-chart @chart-labels @chart-data])
))
you could simply use(defn x-chart []
(let [chart-labels (rf/subscribe [:x/x-labels])
chart-data (rf/subscribe [:x/x-data])]
[gen-x-chart @chart-labels @chart-data]
))
defn chart
[data]
(r/create-class
{:component-did-mount
(fn [this]
(println (r/props this)))
:component-did-update
(fn [this]
(println "updated-data" (r/props this)))
:reagent-render
(fn [data]
[:div (:label data) (:data data)])}))
the up-to-date data are shown at [:h1 (str (js->clj data))] but the chart is using step back data
i'm not sure what cause that delay