```@Composable fun <T> Flow<T>.collect...
# compose
u
Copy code
@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?
z
You’re essentially writing a custom effect. It’s complaining about capitalization because this function doesn’t return a value. I would call this something
CollectEffect
to be more idiomatic.
u
so a top level instead of extension?
z
That might be more idiomatic too, but I don’t think the extension is what the lint check is complaining about
u
yea youre right, but a dot syntax with capital letter function looks weird
z
Yeah, not an extension would probably be nicer
u
plus lambda in capitalized fun makes it look like content
okay thanks!
z
plus lambda in capitalized fun makes it look like content
Effects use this same shape