hi, probably newbie question, but i couldn’t find the answer. what is the idiomatic way for om.next to update clients about server state changes? i have a simple web client where i implemented mutate and read. And a simple server with mutate and read. Everything works fine with one client. I now want to see the changes made by one client in another client. Something with SSE
i can of course implement some proprietary protocol, where server will send updates to all connected clients and clients will perform transact! that will only update the client (and will not send anything to remote)
but it doesn’t sound right
@stask I normally define a custom :merge option in the reconciler, but nowadays, I find there’s nothing wrong with using transact!
@levitanong i’m trying to do it now using om.next/merge!, feels like that’s the right way to do it, but we’ll see 🙂, thanks
@levitanong so yeah, it kind of works. i’m posting results of mutation to an updates channel on server. When client opens EventSource to the server, i tap another channel to the mult created from that updates channel. The client then takes the :result value and calls
(om.next/merge! reconciler novelty)
still not sure thats the right way to do it but it works now 🙂