SavedStateHandleStore

class SavedStateHandleStore(scope: CoroutineScope?, savedStateHandle: SavedStateHandle) : StateFlowStore

A StateFlowStore that wraps a SavedStateHandle.

This can synchronize either

  • two-way (MutableStateFlow<->LiveData) if scope is not null

  • one-way (MutableStateFlow ->LiveData) if scope is null

Depending on whether you already have a scope

Constructors

Link copied to clipboard
constructor(savedStateHandle: SavedStateHandle)

Wraps the given SavedStateHandle and synchronizes one-way from MutableStateFlow to LiveData.

constructor(scope: CoroutineScope?, savedStateHandle: SavedStateHandle)

Functions

Link copied to clipboard
open operator override fun contains(key: String): Boolean
Link copied to clipboard
open override fun <T> getData(key: String, default: T): MutableStateFlow<T>