This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-15
Channels
- # admin-announcements (3)
- # architecture (2)
- # beginners (54)
- # boot (85)
- # braveandtrue (8)
- # cider (21)
- # cljs-dev (56)
- # cljs-site (5)
- # cljsjs (15)
- # cljsrn (9)
- # clojars (4)
- # clojure (99)
- # clojure-austin (1)
- # clojure-russia (36)
- # clojure-spec (53)
- # clojure-uk (29)
- # clojurescript (161)
- # datomic (8)
- # hoplon (3)
- # immutant (48)
- # jobs (1)
- # jobs-rus (1)
- # leiningen (10)
- # om (23)
- # om-next (1)
- # onyx (22)
- # parinfer (3)
- # planck (13)
- # protorepl (8)
- # re-frame (46)
- # reagent (2)
- # remote-jobs (1)
- # respo (1)
- # specter (5)
- # testing (12)
- # untangled (50)
- # yada (13)
How are people integrating a "current user" into their apps? I haven't seen many (any?) examples out there in the wild.
@grzm: if you’re using normalized data, links are the way to go https://github.com/omcljs/om/wiki/Thinking-With-Links%21
@anmonteiro: thank you. and firchrissakes, there's even current-user on that page
@grzm: links are supposed to be a client-only thing.
that said, you can of course update the data that they refer to whenever the server sends something back
I don't want to return all of the user information that the app might need for that person every time I fetch the todo list.
@grzm: just a question of eliding that from the query you’re sending to the server
@anmonteiro: thanks for the help with the union queries. They’re working with one remaining issue– the data is not being normalized. Using union queries doesn’t affect that, correct? (I have the mapentry [:normalize true] in my reconciler args)
@solussd: a number of things could be going on
:normalize true
in the reconciler args will not normalize your data if you pass it inside an atom
if you want normalization to occur during initialization, pass your state as a map
@anmonteiro: the data retrieved from the remote is not being normalized when merged into the local state. My initial state is just a map
@solussd: with union queries you might need to tweak the queries that are sent to the remote
and pass the query as the second argument to the callback in your send function
hmm, the queries look correct, I’m sending the query to the callback as suggested, but still not normalizing . very strange
and the queries are retrieving data (and populating the state, denormalized)
@anmonteiro: even stranger , if I don’t use a union query at all and I send, as the query to the callback, the query from the app-root (which is what is used by default if you simply pass nil) it doesn’t normalize, but if I send nil it does.
I even added the same metadata