Function

observe

Register an observer to be notified when a composition is added to or removed from the given Recomposer.

observe

Source set: Common
public fun Recomposer.observe(
    observer: CompositionRegistrationObserver
): CompositionObserverHandle

Register an observer to be notified when a composition is added to or removed from the given Recomposer. When this method is called, the observer will be notified of all currently registered compositions per the documentation in CompositionRegistrationObserver.onCompositionRegistered.

Parameters

observer the observer that will be informed of new compositions registered with this Recomposer.

Return

a handle that allows the observer to be disposed and detached from the Recomposer.

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: