Instantly share code, notes, and snippets.

@huntc /events.scala
Last active Jul 13, 2018

Embed
What would you like to do?
OO inheritance for data modelling - describes types of events that share a common identifier
sealed abstract class Event(val id: Int)
final case class CountersUpdated(override val id: Int,
counter: Option[Int])
extends Event(id)
final case class DeviceIdUpdated(override val id: Int, deviceId: Int) extends Event(id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment