I've got this code: ``` DisposableEffect(client) { lifecycleScope.launch ...
r
I've got this code:
Copy code
DisposableEffect(client) {
                lifecycleScope.launch {
                    if (client != null) {
                        client?.startSync()
                        Timber.d { "Started sync." }
                    }
                }
                onDispose {
                    client?.stop()
                }
            }
But somehow the
Started sync.
doesn't trigger as soon as client becomes non-null.
a
is startSync a suspend function?
z
Why not use LaunchedEffect for this?
How is
client
defined?