Feature

class Feature<S, T>(val asStateFlow: StateFlow<S>, val actions: T)

Generic feature class that combines UI state observation with feature actions in one place.

This class provides a pattern for exposing both the observable state and the actions available for a particular feature, making it easier to integrate features into Compose UIs.

Parameters

S

The type of the UI state exposed by this feature.

T

The type of the actions interface for this feature.

Constructors

Link copied to clipboard
constructor(asStateFlow: StateFlow<S>, actions: T)

Properties

Link copied to clipboard
val actions: T

The actions interface for interacting with this feature.

Link copied to clipboard
val asStateFlow: StateFlow<S>

The observable state flow for the feature's UI state.