```remember(deeplink) { applyDeeplink(backstac...
# compose
u
Copy code
remember(deeplink) {
    applyDeeplink(backstack, deeplink)
}
is this legal way of running an effect once, such that it doesn't launch a coroutine? (which runs on next frame) obviously I'd wrap it in some nicer api, but fundamentally - is this okay? to use remember and ignore the return value to run some side effect?
no red 1
s
Technically, that will work, practically, you want to run effects after the composition The closest would be
DisposableEffect
with an empty dispose block or a remember observer instance. We actually plan to add a keyed SideEffect to the runtime, maybe in 1.12
u
I see but since it works, whats bad about it? Performance? Correctness?
s
Correctness, effects are executed after composition, remember is executed during composition
u
For learning purposes, how would that manifest? Render that is incorrect / dropping the state update?
s
Order of execution mostly, also going to break during pausable composition potentially
Effects handle cancellation by not executing / disposing in cases when composition is cancelled. This is infrequent enough, but still happens sometimes
u
I'm confused, I'm doing the wrong thing and it appears fine. I'd never know if you wouldn't tell. Is that just not hitting the error case you talk about or does compose somehow error correct?