Launched Task
When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled when the LaunchedTask leaves the composition.
To cancel and re-launch a task when input parameters change, see the overloads of LaunchedTask that accept additional key parameters.
When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled and re-launched when LaunchedTask is recomposed with a different key. The coroutine will be cancelled when the LaunchedTask leaves the composition.
This function should not be used to (re-)launch ongoing tasks in response to callback events by way of storing callback data in MutableState passed to key. Instead, see rememberCoroutineScope to obtain a CoroutineScope that may be used to launch ongoing jobs scoped to the composition in response to event callbacks.
When LaunchedTask enters the composition it will launch block into the composition's CoroutineContext. The coroutine will be cancelled and re-launched when LaunchedTask is recomposed with a different key. The coroutine will be cancelled when the LaunchedTask leaves the composition.
This function should not be used to (re-)launch ongoing tasks in response to callback events by way of storing callback data in MutableState passed to key. Instead, see rememberCoroutineScope to obtain a CoroutineScope that may be used to launch ongoing jobs scoped to the composition in response to event callbacks.