-
-
Save skydoves/2a97dce6ad3e4d92f7e0d9f5c3de013e to your computer and use it in GitHub Desktop.
timeline_ui_response
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
@Serializable | |
data class TimelineUi( | |
val top: TimelineTopUi, | |
val center: TimelineCenterUi, | |
val bottom: TimelineBottomUi | |
) : UiComponent | |
internal class TimelineRepositoryImpl @Inject constructor( | |
private val databaseReference: DatabaseReference, | |
private val json: Json | |
) : TimelineRepository { | |
override fun fetchTimelineUi(): Flow<Result<TimelineUi?>> { | |
return databaseReference.flow( | |
path = { snapshot -> snapshot.child("timeline") }, | |
decodeProvider = { jsonString -> json.decodeFromString(jsonString) } | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment