This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-01
Channels
- # admin-announcements (3)
- # arachne (6)
- # boot (17)
- # cider (51)
- # cljs-edn (19)
- # cljsjs (1)
- # clojure (22)
- # clojure-russia (154)
- # clojurebridge (5)
- # clojurescript (20)
- # cursive (1)
- # emacs (2)
- # ldnclj (1)
- # liberator (1)
- # mount (1)
- # om (44)
- # onyx (6)
- # ring-swagger (4)
- # rum (30)
- # slack-help (8)
- # untangled (40)
@dimiter: I believe untangled by design avoids using query params from UI components.
instead this sort of thing is accomplished via transactions into app-state
AFAIK
@mahinshaw: Thanx for suggestion, but there are cases when some "entitiy" has some fields which are only generated on server, and I don't speak about IDs only, so client cannot guess what they are because they are not entered via some client input form, so in that case to get complete entity presented on UI, the only way is to wait for server to return this entity representation, whether in HTTP response of mutation operation or in subsequent reload operation, no?
I'm working through the Untangled tutorial (pretty good so far), and I noticed that the query editors don't work properly. I have to refresh the page to get my new query to load
in part E "UI Query and Exercises" the exercise has me add an ident to a component. I don't think this has been explained in the tutorial yet.
The tutorial has mentioned idents lots of times, but nothing about attaching them to components or what that means
Alright, I've no idea what I'm supposed to do. Anyone have a moment to help me out?
;; TODO: Add root query. Remember to include top-level properties and compose in PeopleWidget
static om/IQuery
(query [this] `[:widget {:people ~(om/get-query Person)}])
This is what I have right now:
(defui Person
;; TODO: Add a query for :db/id, :person/name, and a recursive access of :person/mate
;; TODO: Add an ident that uses :db/id
static om/IQuery
(query [this] '[:person/name {:person/mate [:person/name]}])
static om/Ident
(ident [this {:keys [id]}] [:db/id id])
(defui Root
;; TODO: Add root query. Remember to include top-level properties and compose in PeopleWidget
static om/IQuery
(query [this] `[{:db/id ~(om/get-query Person)}
:widget
:new-person
:last-error])
And nothing new on PeopleWidget.https://github.com/untangled-web/untangled-tutorial/blob/master/src/tutorial/untangled_tutorial/E_UI_Queries_and_State_Exercises.cljs This is the exercise.
I don't really understand what "compose in PeopleWidget" means. If anyone could point me in the right direction, I'd appreciate it
@kauko: you are asking the right questions but keep in mind this stuff is probably going to take some time to sink in. Om.next is not one of those build a toy app in an afternoon type frameworks.
I suggest you slow down and make sure you understand each piece before moving on to the next.
What do you think an ident is?
Have you worked with datomic at all?
I like to think of it as a table name + id
Do you understand what the tutorial means when it talks about the app state having tables?
So the next thing I think is to understand is that om requires your UI components to match your app state tables
This includes queries, hierarchy and ids
an example might help
say you have a person table
{:person/by-id {1 {:person/id 1 :person/name “bob”}}
in your app state
in your UI when you want to render a person entity the query could be [:person/name]
and the ident would be [:person/by-id 1]
for bob
so basically if you have a component that describes a particular entity in app state, for example a form for editing persons, then the ident tells you which particular entity in app state the component represents
cool, so what doesn’t make sense about idents then?
Oh, the ident part was mostly about defining it for the component, since that was the first time the tutorial mentioned such a thing. Feedback, you know?
which TODO is causing trouble?