This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-22
Channels
- # arachne (8)
- # bangalore-clj (1)
- # beginners (72)
- # boot (95)
- # braveandtrue (5)
- # business (1)
- # capetown (1)
- # cider (180)
- # cljs-dev (8)
- # cljsrn (20)
- # clojure (104)
- # clojure-art (1)
- # clojure-brasil (8)
- # clojure-czech (1)
- # clojure-greece (15)
- # clojure-korea (13)
- # clojure-poland (2)
- # clojure-russia (53)
- # clojure-sg (5)
- # clojure-spec (60)
- # clojure-uk (35)
- # clojurescript (186)
- # community-development (3)
- # core-async (24)
- # cursive (18)
- # datascript (11)
- # datomic (39)
- # devcards (4)
- # emacs (2)
- # events (1)
- # funcool (23)
- # hoplon (148)
- # juxt (1)
- # ldnclj (2)
- # luminus (1)
- # off-topic (22)
- # om (27)
- # onyx (35)
- # overtone (2)
- # pedestal (7)
- # perun (8)
- # protorepl (2)
- # rdf (6)
- # re-frame (15)
- # reagent (2)
- # ring-swagger (10)
- # untangled (54)
What is the idiomatic way of coming up with idents for components that are only ever on the dom tree once?
I’m currently using [:child/by-id “ComponentName”]
@berkeleytrue iirc :singleton
is a pattern ive seen throughout cookbooks and tests
not sure you’d use :thing/by-id
with that though
as its not really an id...
I would want to get away from /by-id
So would the ident be something like [:main :singleton]?
Is there a reference somewhere for the parser that has a legend of these keywords?
This is more of an om.next question but I figure more people here have experience writing real applications. Does anyone know of any patterns for forcing a remote read or delaying a read until after an event? My specific use case is that I have a mutate that logs a user in and acquires a JWT token and I need to delay or re-run some requests after receiving that token in order to authenticate..
@danielstockton I’m guessing you are talking out delaying the on-tarted-callback
reads? If that’s the case, you can make a transaction out of those reads, and call that transaction after your auth process.
im actually not using untangled, but i was hoping some patterns may have developed here that i could borrow
@danielstockton There really isn’t a pattern, as such. The thing is that Om Next in general has a specific model for how you model remote interactions. Delaying is an orthogonal concern. You could use setTimeout or something similar.
If you’re talking about possibly triggering another action after a particular network request finishes, then that has a bit more to it in the Om Next model, since the return sequence in Om Next isn’t explicitly defined
The only events you have are UI events, end of processing (e.g. return from networking), and anything you make up (e.g. via setTimeout)
setTimeout…again: keep hold of the reconciler (which in Untangled is in the app), and use transact!
the network pipeline is for you to write, so you plug into that however you see fit…there is more to say about Om Next, but it is along the lines of “you plug that into the merge/migrate mechanisms"
@tony.kay Is there some way to force a remote re-read? I transact and force a re-read, but it doesn't hit the remote. This is my problem.
@danielstockton This is not related to untangled at all. But this might be interesting for you: https://github.com/omcljs/om/wiki/Documentation-(om.next)#force
@mitchelkuijpers tried that, i don't think its all hooked up yet
i don't see the :target being added to the ast
@danielstockton In Om Next quoting is used to mark AST with remote
Oh I am pretty sure that works, did you add a ~
?
in Untangled, we have all of that pre-coded so the loading story is clear…no parser emitting code required
(om/transact! component
`[(user/login {:username ~username :password ~password}) ~(om/force :totals :api)])
I can't get it to work, or at least not as expected. I'm checking the read function and expecting the ast to have :target :api
this is definitely more of an #om discussion…all of these complications aren’t necessary with Untangled
Yeah, I had no luck there earlier, but I'll try again.
It might be, I'm probably re-implementing a lot of things it solves, but it's a good learning exercise to discover them for myself.
Is untangled opinionated about the server-side? I'm dealing with a django application on the backend.
It’s easier if you use the server side. The SNAPSHOT version of server was just refactored to pull apart the bits so you can build it into your own web server.
seems like you lose a lot of the benefits if you don’t at least have a core API endpoint in Clojure
no, i actually wanted to write a parser for the om query syntax and have a single endpoint, with a few exceptions
i managed to get some way in python using python-transit
I'll have to look into it
The primary things we handle for you on the server are catching exceptions, wrapping up tempid remaps, and a few other trivial things. Stuff you’d have to write yourself, but it’s just not a lot
We still need to write docs on our new server stuff that’s been teased apart. But yeah, if you’re using python on the server you’d have to write a query parser
untangled server @ 0.7.0-SNAPSHOT has docstrings on the new untangled-system
function for building a server
once I have some time this week I will be porting untangled-template to use it, and adding some docs to the devguide
Ok, i'll keep an eye out, I definitely need to dig into untangled more