Skip to content

Instantly share code, notes, and snippets.

@MaxMichel2
Last active June 12, 2024 14:25
Show Gist options
  • Save MaxMichel2/269b4036b4fece960cf268c9869a67b5 to your computer and use it in GitHub Desktop.
Save MaxMichel2/269b4036b4fece960cf268c9869a67b5 to your computer and use it in GitHub Desktop.
The actual implementation of the ViewEvent for the ForYouScreen (from the Now In Android application)
@Immutable
sealed class ForYouEvent : Reducer.ViewEvent {
data class UpdateTopicsLoading(val isLoading: Boolean) : ForYouEvent()
data class UpdateTopics(val topics: List<FollowableTopic>) : ForYouEvent()
data class UpdateNewsLoading(val isLoading: Boolean) : ForYouEvent()
data class UpdateNews(val news: List<UserNewsResource>) : ForYouEvent()
data class UpdateTopicsVisible(val isVisible: Boolean) : ForYouEvent()
data class UpdateTopicIsFollowed(val topicId: String, val isFollowed: Boolean) : ForYouEvent()
data class UpdateNewsIsSaved(val newsId: String, val isSaved: Boolean) : ForYouEvent()
data class UpdateNewsIsViewed(val newsId: String, val isViewed: Boolean) : ForYouEvent()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment