-
-
Save skydoves/b28d1a771cc0a1d6be72c6301cdaa644 to your computer and use it in GitHub Desktop.
flow_ktx
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
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