This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-29
Channels
- # announcements (1)
- # biff (5)
- # calva (10)
- # cljdoc (4)
- # clojure (17)
- # clojure-europe (15)
- # clojure-norway (38)
- # clojurescript (53)
- # community-development (1)
- # cursive (2)
- # datomic (14)
- # fulcro (11)
- # funcool (1)
- # hyperfiddle (7)
- # introduce-yourself (2)
- # jobs-discuss (17)
- # missionary (7)
- # releases (4)
- # shadow-cljs (30)
- # slack-help (6)
- # specter (5)
- # squint (22)
Hey Tony and gangs.
I have a question regarding custom remote. Following the section on creating a custom remote in the book, I've successfully created a custom remote that interacts with some other part of the app.
Right now, everything is synced, I make a load!
, transmit!
calls some internal module that does some internal HTTP requests, then returns the result as a normal JSON object.
Those internal modules can either return the full response body, or a promise. Since I'm looking into something non-blocking, how well does transmit!
work with promises? Do you have any examples?
I had a look into http-remote
and it seems like the default fulcro-http-remote
relies mostly on xhrio
for all of its low-level request/response ops.
Thanks in advance.
so promises are fine. I’ve got a remote I defined that starts up and talks to a web worker, for example, which of course does async comms
Interesting. When I tried using promises I got some parsing errors which I thought it was because I wasn't allowed to do so. I'll have another look at the code. Thanks a lot 🙂
yeah, it isn’t promises that are your problem. You just are not transforming the data as expected. Correct. The return value of transmit is ignored
transmit should start some async op, and then call the result-handler
from the send-node when done.