Side effects - makstron/info GitHub Wiki
Side-effects
Виконуються після композиції
- LaunchedEffect - run suspend functions in the scope of a composable (привязаний до докального скоупу, виконується при першій композиції)
- rememberCoroutineScope - obtain a composition-aware scope to launch a coroutine outside a composable
- rememberUpdatedState - reference a value in an effect that shouldn't restart if the value changes (створює стейт зі змінної і оновлює його при зміні змінної)
- DisposableEffect - працює як LaunchedEffect але без корутин і має метод onDispose
- SideEffect - публікує Compose state в non-Compose код (виконується щоразу)
- produceState - convert non-Compose state into Compose state
- derivedStateOf - convert one or multiple state objects into another state (save some computation until parameters for computation the same) (викликається перед композицією)
- snapshotFlow - convert Compose's State into Flows
https://www.youtube.com/watch?v=gxWcfz3V2QE&ab_channel=PhilippLackner