ursus
03/09/2026, 10:59 PM@Composable
fun <T> Flow<T>.collectAsLaunchedEffect(onEach: suspend (T) -> Unit) {
val currentOnEach by rememberUpdatedState(newValue = onEach)
LaunchedEffect(key1 = this) {
collect(currentOnEach)
}
}
is this such a bad shape?
linter complains about it not having a capitalized name
but it's a extension -- is this fine you think?Zach Klippenstein (he/him) [MOD]
03/10/2026, 6:51 PMCollectEffect to be more idiomatic.ursus
03/10/2026, 6:52 PMZach Klippenstein (he/him) [MOD]
03/10/2026, 6:55 PMursus
03/10/2026, 6:59 PMZach Klippenstein (he/him) [MOD]
03/10/2026, 6:59 PMursus
03/10/2026, 7:00 PMursus
03/10/2026, 7:00 PMZach Klippenstein (he/him) [MOD]
03/10/2026, 7:28 PMplus lambda in capitalized fun makes it look like contentEffects use this same shape