Created
November 24, 2020 15:19
-
-
Save esilverberg/a84eb6d11f520a76c74786beeb7b6d6c to your computer and use it in GitHub Desktop.
This file contains 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
// 🍎 | |
enum MatchState { | |
case initial | |
case error(error: MatchError) | |
case loading | |
case started(stack: MatchStack) | |
case finished(moreStacksAvailable: Bool, canLoadMoreStacks: Bool, newStackAt: Date) | |
} | |
enum Event { | |
case mutualMatch(with: PSSUser) | |
case premiumRequired | |
case exitMatch | |
case visitLocationDiagnostics | |
case visitMutualMatches | |
} | |
// 🤖 | |
sealed class MatchState { | |
object Initialized : MatchState() | |
class Error(val error: MatchError) : MatchState() | |
object Loading : MatchState() | |
class Started(val stack: MatchStack) : MatchState() | |
class Finished(val moreStacksAvailable: Boolean, val canLoadMoreStacks: Boolean, val newStackAt: Date) : MatchState() | |
} | |
sealed class Event { | |
class MutualMatch(val withProfile: Profile) : Event() | |
object PremiumRequired : Event() | |
object ExitMatch : Event() | |
object VisitLocationDiagnostics : Event() | |
object VisitMutualMatches : Event() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment