dewildte
06/18/2024, 5:49 PMcomposeResources/files
.
How would I got about extracting the text in that file from a Composable?dewildte
06/18/2024, 5:52 PMvar bytes by remember {
mutableStateOf(ByteArray(0))
}
LaunchedEffect(Unit) {
bytes = Res.readBytes("files/somefile.md")
}
Text(bytes.decodeToString())
Edit: This works!Konstantin Tskhovrebov
06/18/2024, 7:07 PMdewildte
06/18/2024, 7:10 PMyschimke
06/18/2024, 7:50 PMyschimke
06/18/2024, 7:50 PMdewildte
06/18/2024, 7:53 PMKonstantin Tskhovrebov
06/18/2024, 7:53 PMAlmost all resources are read synchronously in the caller thread. The only exceptions are raw files and all of the resources on the JS platform that are read asynchronously.
Konstantin Tskhovrebov
06/18/2024, 7:54 PMyschimke
06/18/2024, 7:54 PMdewildte
06/18/2024, 8:00 PM<http://Dispatchers.IO|Dispatchers.IO>
?Konstantin Tskhovrebov
06/18/2024, 8:19 PMdewildte
06/18/2024, 8:19 PMdewildte
06/18/2024, 8:19 PM