Skip to content

Commit 5b0267b

Browse files
Merge pull request #1563 from liveview-native/diff_on_main
Handle diff on main actor
2 parents c6b6d4e + 9a01c73 commit 5b0267b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/LiveViewNative/Coordinators/LiveViewCoordinator.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
314314

315315
func bindDocumentListener() {
316316
let handler = SimplePatchHandler()
317-
patchHandlerCancellable = handler.patchEventSubject.sink { [weak self] patch in
317+
patchHandlerCancellable = handler.patchEventSubject
318+
.receive(on: DispatchQueue.main)
319+
.sink { [weak self] patch in
318320
switch patch.data {
319321
case .root:
320322
// when the root changes, update the `NavStackEntry` itself.

0 commit comments

Comments
 (0)