Open Bug 1832624 Opened 2 years ago Updated 2 years ago

Remove original observeAsComposableState

Categories

(Firefox for Android :: General, enhancement, P3)

All
Android
enhancement

Tracking

()

People

(Reporter: matt-tighe, Unassigned)

References

Details

(Whiteboard: [fxdroid])

With the introduction of the non-nullable observeAsComposableState in this patch, we could potentially remove the old nullable version to clean up a lot of unnecessary null guarding.

  1. Check whether all usages can safely provide a initial value (from a store or otherwise)
  2. Refactor all old fun <S : State, A : Action, R> Store<S, A>.observeAsComposableState(map: (S) -> R): ComposeState<R?> usages to the new signature:
@Composable
fun <S : State, A : Action, R> Store<S, A>.observeAsComposableState(
    initialValue: R,
    map: (S) -> R,
): ComposeState<R> { 

It's also worth considering the impact this would have on other A-C consumers.

Severity: S4 → N/A
You need to log in before you can comment on or make changes to this bug.