# RxRoom

Added in 3.0.2

*** ** * ** ***


```
public final class RxRoom
```

<br />

*** ** * ** ***

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/room3/rxjava3/RxRoom#NOTHING()` Data dispatched by the publisher created by `https://developer.android.com/reference/androidx/room3/rxjava3/package-summary#createFlowable(androidx.room3.RoomDatabase,kotlin.Boolean,kotlin.Array,kotlin.coroutines.SuspendFunction1)`. |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html>` | `https://developer.android.com/reference/androidx/room3/rxjava3/RxRoom#createFlowable(androidx.room3.RoomDatabase,kotlin.Array)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/room3/RoomDatabase database, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html... tableNames )` Creates a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` that emits at least once and also re-emits whenever one of the observed tables is updated. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html>` | `https://developer.android.com/reference/androidx/room3/rxjava3/RxRoom#createObservable(androidx.room3.RoomDatabase,kotlin.Array)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/room3/RoomDatabase database, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html... tableNames )` Creates a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` that emits at least once and also re-emits whenever one of the observed tables is updated. |

## Public fields

### NOTHING

Artifact: [androidx.room3:room3-rxjava3](https://developer.android.com/jetpack/androidx/releases/room3) [View Source](https://cs.android.com/search?q=file:androidx/room3/rxjava3/RxRoom.kt+symbol:NOTHING) Added in [3.0.2](https://developer.android.com/jetpack/androidx/releases/room3#3.0.2)

```
public static final @NonNull Object NOTHING
```

Data dispatched by the publisher created by `https://developer.android.com/reference/androidx/room3/rxjava3/package-summary#createFlowable(androidx.room3.RoomDatabase,kotlin.Boolean,kotlin.Array,kotlin.coroutines.SuspendFunction1)`.

## Public methods

### createFlowable

Artifact: [androidx.room3:room3-rxjava3](https://developer.android.com/jetpack/androidx/releases/room3) [View Source](https://cs.android.com/search?q=file:androidx/room3/rxjava3/RxRoom.kt+function:createFlowable) Added in [3.0.2](https://developer.android.com/jetpack/androidx/releases/room3#3.0.2)

```
public static final @NonNull Flowable<@NonNull Object> createFlowable(
    @NonNull RoomDatabase database,
    @NonNull String... tableNames
)
```

Creates a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` that emits at least once and also re-emits whenever one of the observed tables is updated.

You can easily chain a database operation to downstream of this `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` to ensure that it re-runs when database is modified.

Since database invalidation is batched, multiple changes in the database may results in just 1 emission.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/room3/RoomDatabase database` | The database instance |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html... tableNames` | The list of table names that should be observed |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html>` | A `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` which emits `https://developer.android.com/reference/androidx/room3/rxjava3/package-summary#NOTHING()` when one of the observed tables is modified (also once when the invalidation tracker connection is established). |

### createObservable

Artifact: [androidx.room3:room3-rxjava3](https://developer.android.com/jetpack/androidx/releases/room3) [View Source](https://cs.android.com/search?q=file:androidx/room3/rxjava3/RxRoom.kt+function:createObservable) Added in [3.0.2](https://developer.android.com/jetpack/androidx/releases/room3#3.0.2)

```
public static final @NonNull Observable<@NonNull Object> createObservable(
    @NonNull RoomDatabase database,
    @NonNull String... tableNames
)
```

Creates a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` that emits at least once and also re-emits whenever one of the observed tables is updated.

You can easily chain a database operation to downstream of this `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` to ensure that it re-runs when database is modified.

Since database invalidation is batched, multiple changes in the database may results in just 1 emission.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/room3/RoomDatabase database` | The database instance |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html... tableNames` | The list of table names that should be observed |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html>` | A `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` which emits `https://developer.android.com/reference/androidx/room3/rxjava3/package-summary#NOTHING()` when one of the observed tables is modified (also once when the invalidation tracker connection is established). |