This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-15
Channels
- # admin-announcements (2)
- # beginners (93)
- # boot (34)
- # capetown (1)
- # cider (15)
- # cljs-dev (30)
- # cljsjs (9)
- # clojars (8)
- # clojure (199)
- # clojure-austin (3)
- # clojure-france (3)
- # clojure-greece (2)
- # clojure-italy (46)
- # clojure-quebec (7)
- # clojure-russia (2)
- # clojure-spec (76)
- # clojure-uk (16)
- # clojurescript (43)
- # core-async (7)
- # cursive (14)
- # data-science (1)
- # datascript (4)
- # datomic (3)
- # devcards (60)
- # editors (5)
- # funcool (5)
- # garden (3)
- # hoplon (32)
- # immutant (22)
- # jobs (1)
- # lein-figwheel (21)
- # leiningen (1)
- # mental-health (11)
- # mount (2)
- # off-topic (6)
- # om (16)
- # onyx (15)
- # re-frame (43)
- # reagent (20)
- # rum (18)
- # specter (37)
- # sql (2)
- # testing (8)
- # untangled (7)
- # yada (19)
I’m playing with Rum’s Server-side rendering(https://github.com/tonsky/rum#server-side-rendering). What’s the approach for sharing data between server and client? For example, I render a collection which queried from database on server-side. How do I get an access to manipulate this collection on client-side? Should I make a separate ajax call to retrieve similar data? Is there a better way to do this?
i’d do an ajax call @tap
@biscuitpants: thanks
render your initial data, then setup a periodic ajax call if you want periodic updates. you can then use ajax to post updates on your data
I’m just doing live filtering on that data. There’s no update at the moment. It would be ideal if I can piggyback the data with the first html load.
live filtering client side?
It just a that if I don’t need ajax call, I can remove an api endpoint and some dependencies. But I think eventually I’ll do more, so I think I’ll need those anyway
what dependencies are you using for ajax?
well, you can use goog.net.xhrio instead of cljs-ajax
the google Closure library is jam packed with libraries https://developers.google.com/closure/library/docs/gettingstarted
and you get them for free, since the closure library is used when compiling cljs to javascript — no dependencies need to be added
@tap we solved that by baking in serialized data to HTML page, find it when page loads on client
Thanks @biscuitpants @tonsky