---
title: "observe"
description: "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]."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
@ExperimentalComposeRuntimeApi
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`. |


#### Returns

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




