Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jacobsapps/6818444312b26add6292a4d43144a23a to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/6818444312b26add6292a4d43144a23a to your computer and use it in GitHub Desktop.
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