This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-18
Channels
- # announcements (10)
- # babashka (21)
- # beginners (99)
- # biff (66)
- # catalyst (3)
- # cherry (1)
- # cider (11)
- # clojure (38)
- # clojure-austin (3)
- # clojure-dev (23)
- # clojure-europe (21)
- # clojure-hungary (10)
- # clojure-nl (2)
- # clojure-norway (57)
- # clojure-uk (2)
- # clojurescript (9)
- # cursive (6)
- # fulcro (5)
- # hyperfiddle (14)
- # integrant (4)
- # introduce-yourself (3)
- # lsp (24)
- # off-topic (14)
- # reagent (12)
- # reitit (13)
- # releases (8)
- # sci (16)
- # shadow-cljs (8)
- # solo-full-stack (1)
- # spacemacs (5)
- # squint (3)
- # xtdb (14)
Does Electric depend on websockets, or will it fallback to other transport methhods like long polling? Considering using Electric to build software for a client that they will ship to their client’s on-prem environments, and there’s probably varying networking setups there.
electric abstracts the transport away, you basically provide a reader and a writer. That said we did not build any other transport method yet

Is it possible to do something like this with current state of ui or will there be something in the future?
(let [data (dom/input
(dom/props {::dom/type "text" })
(dom/on "input" (fn [e] (println (-> e .-target .-value)))))]
(println data))
Or is the recommended way still using an atom (dom/on … (reset! atom value))
?dom/input
and friends return whatever the body returns. dom/on
returns the result of your callback. So technically what you wrote should work, if you drop the println. The behavior might not be what you're looking for though. What are you trying to accomplish?
just have a reactive value of the input data, that I then can use further downstream. E.g. pseudo code:
(let [username (dom/input...)
password (dom/input ..)]
(dom/button (dom/on "click (e/fn (s/server (authenticate username password) ...))))
Since here you're only reading state locally you can do it more efficiently/directly through missionary interop as e.g. https://github.com/hyperfiddle/electric/blob/5a3799bdca4f70aed0dc51ac98ff9728dbffacae/src/hyperfiddle/electric_dom2.cljc#L245 does. The downside of this approach is the value is only available downstream (e.g. if you mount your button before the input it cannot accesss the value). An atom and dom/on
will always work
Hello everyone, I would like to ask something. I could solve my problem by changing my code but I wanted to learn the root cause of the problem and how to solve it. My project-id client-company client-person is not working as expected. When I change them manually my whole code works as expectedly and the first query which is inside of the let block is working I checked in repl.
can you describe what the problem is? Is there an exception, is the transaction not visible in the DB, is the UI not updating?
A couple notes
• you should e/watch
an atom only once, creating multiple watches can result in glitches
• the roundtrip of project-id
etc isn't necessary, move the let
and d/transact
inside a single e/server
block
Hello again, It is not related to UI, I just want to get some data dynamically by queries. Data doesn't come in time. Or I don't know what happens but When I manually give that let variables then the code works stable. I think the problem is in my let binding.
Thanks, as you said I collected them in the same server block and the function started running nicely.
Dropping this link here because I haven't seen it publicized anywhere and I think it would be interesting to this community: https://github.com/tonsky/datascript/blob/master/docs/storage.md#storage-new-hot-best