scopeState<LocalState> method

Store<LocalState, A> scopeState<LocalState>({
  1. required LocalState toLocalState(
    1. S
    ),
})

Creates a scoped store that projects only the state, keeping the same action type.

This is a convenience wrapper around scope for cases where actions do not need to be transformed.

Implementation

Store<LocalState, A> scopeState<LocalState>({
  required LocalState Function(S) toLocalState,
}) =>
    scope(toLocalState: toLocalState, toGlobalAction: (action) => action);