You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
View state in SwiftUI must only be changed on the main thread (nee main actor). We currently force effects onto the main thread through .receive(on: DispatchQueue.main). However, we do not force send on to the main thread, relying on callers to do the right thing, and SwiftUI to complain if you don't.
It might be nice to force send onto the main thread to make changing state off main thread impossible. We might do this through decorating Store with @MainActor or perhaps through decorating send with @MainActor.
Tested in-app on 2023-07-07. No major problems, but a few Converting function value of type '@MainActor (NotebookAction) -> ()' to '(NotebookAction) -> Void' loses global actor 'MainActor'. We may want to make send nonisolated.
The text was updated successfully, but these errors were encountered:
View state in SwiftUI must only be changed on the main thread (nee main actor). We currently force effects onto the main thread through
.receive(on: DispatchQueue.main)
. However, we do not forcesend
on to the main thread, relying on callers to do the right thing, and SwiftUI to complain if you don't.It might be nice to force
send
onto the main thread to make changing state off main thread impossible. We might do this through decorating Store with@MainActor
or perhaps through decoratingsend
with@MainActor
.Code Sketch
Tested in-app on 2023-07-07. No major problems, but a few
Converting function value of type '@MainActor (NotebookAction) -> ()' to '(NotebookAction) -> Void' loses global actor 'MainActor'
. We may want to makesend
nonisolated.The text was updated successfully, but these errors were encountered: