Property

snapshotObserver

Source set: Android
override val snapshotObserver = OwnerSnapshotObserver { command ->
        val exceptionHandler = uncaughtExceptionHandler
        val command =
            if (exceptionHandler != null) {
                {
                    try {
                        command()
                    } catch (e: Exception) {
                        exceptionHandler.onUncaughtException(e)
                    }
                }
            } else {
                command
            }

        if (handler?.looper === Looper.myLooper()) {
            command()
        } else {
            handler?.post(command)
        }
    }
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: