Skip to content

[Viewmodel] Support flow StateObservable on iOS#32

Merged
npresseault merged 1 commit into
mainfrom
flow-support
Jan 5, 2026
Merged

[Viewmodel] Support flow StateObservable on iOS#32
npresseault merged 1 commit into
mainfrom
flow-support

Conversation

@npresseault

Copy link
Copy Markdown
Contributor
  • Support Flow in NullableStateObservable and StateObservable. initial value must be provided.
  • Support Flow in PilotAccessibility component bindings.

We had a specific use case where we wanted to use a Flow instead of a StateFlow for accessibility but I'm pretty sure we could find more use cases for Flow observation.

This is the equivalent of using collectAsState on android.

@Composable
public fun <T : R, R> Flow<T>.collectAsState(
    initial: R,
    context: CoroutineContext = EmptyCoroutineContext,
): State<R>

…value must be provided.

Support Flow in PilotAccessibility

We had a specific use case where we wanted to use a Flow instead of a StateFlow for accessibility but I'm pretty sure we could find more use cases for Flow observation.
@npresseault npresseault merged commit 2524066 into main Jan 5, 2026
1 check passed
@npresseault npresseault deleted the flow-support branch January 5, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants