Compose: side effects Core principle Composable bodies describe UI. They can be recomposed, skipped, or abandoned. Work that changes the outside world belongs in an effect API whose lifecycle matches the work. Pick the smallest effect | Need | API | |---|---| | Publish Compose state to non-Compose code after every successful recomposition | | | Register/unregister a listener, callback, observer, or resource | | | Run suspending, deferred, or keyed one-shot work | | | Launch suspending work from a user event callback | | | Convert Compose snapshot reads into a Flow inside a coroutine | inside…