Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jacobsapps/5581894fc948b5b4043fdaa67616d66a to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/5581894fc948b5b4043fdaa67616d66a to your computer and use it in GitHub Desktop.
import Combine
import Charts
struct AuctionView: View {
let webSocketService = WebSocketServiceImpl.getOrCreateInstance(endpoint: "auction")
@State private var highestBid: AuctionBid?
@State private var bidHistory: [AuctionBid] = []
@State private var timeRemaining: Int = 120
@State private var timer: Timer.TimerPublisher = Timer.publish(every: 1, on: .main, in: .common)
@State private var cancellables = Set<AnyCancellable>()
@State private var hasStarted = false
private let decoder = JSONDecoder()
var body: some View {
HStack {
VStack {
Image("monalisa")
// ...
}
Chart(bidHistory) { bid in
// ...
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment