Created
December 29, 2025 17:55
-
-
Save mrenouf/ce82af4fa7012982740783101ff13b05 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import import kotlinx.io.Source | |
| import kotlinx.io.readLine | |
| import kotlinx.serialization.json.Json | |
| private inline fun <reified T> jsonlFlowOf(json: Json, source: Source): Flow<T> { | |
| return flow { | |
| val line = source.readLine() ?: return@flow | |
| emit(json.decodeFromString(line)) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment