register<T extends LiveData> method

T register<T extends LiveData>(
  1. T value
)
inherited

Registers an existing LiveData in the ViewModel's scope.

The registered LiveData will be automatically disposed when the ViewModel is disposed. Use this when you create LiveData instances that aren't created with mutable.

Example:

final custom = register(CustomLiveData());

Implementation

T register<T extends LiveData>(T value) => scope.add(value);