Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jacobsapps/037915d52c9dd5ab0e631d97b1e8b1a4 to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/037915d52c9dd5ab0e631d97b1e8b1a4 to your computer and use it in GitHub Desktop.
webSocketService.publisher
.decode(type: GameState.self, decoder: decoder)
.receive(on: RunLoop.main)
.removeDuplicates()
.filter { !$0.characters.isEmpty }
.sink(
receiveCompletion: { print($0) },
receiveValue: { state in
currentGame = state
}
)
.store(in: &cancellables)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment