How do I temporarily disable change tracking in liveview?

At some states of my liveview application, the server side is expecting back to back events, and each handle_event will update some part of the socket assigns. Can I disable the change tracking in between the events? I want to reduce the flicker due to the 2 updates.

Haven’t tested it, but maybe you mark one of your containers with something like phx-update=@update_flag

where the assign update_flag is set to “replace” on mount (the default behavior), “ignore” in the first event handler (or maybe sometime before), and then back to “replace” in the second event handler

https://hexdocs.pm/phoenix_live_view/dom-patching.html

It is an interesting idea; however I cannot use it here. My problem is dealing with the first 2 events ever received after a disconnect and live view reload. I cannot control when the network would break; if I do, there will be no network breakage at all :slight_smile: