Created
May 30, 2025 07:13
-
-
Save jacobsapps/6818444312b26add6292a4d43144a23a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct GameView: View { | |
| let webSocketService: WebSocketService | |
| @State private var currentGame: GameState? | |
| @State private var cancellables = Set<AnyCancellable>() | |
| @State private var hasStarted = false | |
| private let decoder = JSONDecoder() | |
| init(webSocketService: WebSocketService = WebSocketServiceImpl.getOrCreateInstance(endpoint: "game")) { | |
| self.webSocketService = webSocketService | |
| } | |
| var body: some View { | |
| Canvas { context, size in | |
| // ... | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment