Created
May 30, 2025 07:10
-
-
Save jacobsapps/c7eab6d6a35fc7f94462ed4ccaf73224 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 MockWebsocketService: WebSocketService { | |
| let publisher: AnyPublisher<Data, Error> | |
| init(characters: [GameState.GameCharacter]) { | |
| let state = GameState(characters: characters) | |
| let data = try! JSONEncoder().encode(state) | |
| self.publisher = Just(data) | |
| .setFailureType(to: Error.self) | |
| .eraseToAnyPublisher() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment