Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
"test", "example", "25
@MainActor
public protocol ViewModel<State>: ObservableObject {
associatedtype State: Sendable
var state: State { get }
}
public enum ViewState<D: Sendable, E: Sendable>: Sendable {
case initial
case loading
import SwiftUI
import PlaygroundSupport
@MainActor
final class ViewModel1: ObservableObject {
@Published var count = 0
}
@MainActor
final class ViewModel2: ObservableObject {