Fork me on GitHub
#untangled
<
2017-06-11
>
bbktsk15:06:25

Hello! Is there some example on how to use untangled client with non-Om based server? A legacy REST server, for example?

tony.kay17:06:30

@bbktsk No, but it isn’t that hard. Look in the network namespace(s) in Untangled for the UntangledNetwork protocol and implemetation. Essentially you make such a networking object that can take your client request from the UI and turn it into the proper REST calls, and transform the response into EDN. So, summary: 1. Implement UntangledNetwork (essentially write a send method that can deal with your REST comms) 2. Install an instance as a remote on the client. Possibly as an alternate remote, like :rest 3. In your queries/mutations, name that remote: (load this :kw Component {:remote :rest})

tony.kay17:06:34

then just remember that the Om query (from a component) is used in data normalization, so even though you may not need that to talk to your REST server, you’ll want the load system to know the full query so that when you obtain it, the value can be normalized into your db.

tony.kay17:06:35

I.e. (load this :some-kw nil {:remote :rest}) will work, but any data you return from the remote will just end up as an opaque blob of data at the root of your db at :some-kw.

tony.kay17:06:50

It isn’t done yet, but I think it improves over the other resources I’ve written (to date) in giving a summary of the motivation and benefits of the overall model. The loading bit isn’t done yet (possibly today), but the db and normalization stuff, I think, is pretty good.

bbktsk22:06:21

@tony.kay Awesome, thanks, I will try that! I’ve read the new Getting Started and it made a couple of things clearer for me.

tony.kay22:06:36

great, thanks for the feedback

tony.kay22:06:00

the loading stuff I’m working on should also make that part much clearer. I added a section on traditional REST (yet to be written) because it keeps being asked

az23:06:05

Hi @tony.kay, thanks for the great work on untangled. Was wondering what your thoughts were on building a realtime app with untangled

tony.kay23:06:20

I think it is pretty well-suited, esp since websockets support is available as a networking option.

tony.kay23:06:52

if that’s what you mean…if you mean like animation in gaming? less so.

tony.kay23:06:07

you’d write most of that kind of thing in lower-level stuff for speed