Skip to main content

Reservoir Reference

Overview​

Reservoir is the Mississippi client-state management subsystem.

Applies To​

  • Mississippi.Reservoir.Abstractions
  • Mississippi.Reservoir.Core
  • Mississippi.Reservoir.Client
  • Mississippi.Reservoir.TestHarness

Public Registration Entry Points​

Entry pointReceiverReturnsPurpose
AddReservoir()IServiceCollectionIReservoirBuilderCreate the top-level Reservoir builder from DI
AddReservoir()WebAssemblyHostBuilderIReservoirBuilderCreate the same builder from Blazor WebAssembly startup

Source code:

IReservoirBuilder​

IReservoirBuilder is the top-level public registration contract.

MemberPurpose
ServicesAdvanced access to the underlying IServiceCollection
AddFeatureState<TState>()Register a feature state without extra reducers or effects
AddFeatureState<TState>(configure)Register a feature state and configure reducers or effects in one callback
AddMiddleware<TMiddleware>()Add middleware to the Reservoir dispatch pipeline

The Services property is marked advanced in the public contract. The normal direction is to compose through builder extension methods instead of writing more direct service registrations in application startup.

IReservoirFeatureBuilder​

IReservoirFeatureBuilder<TState> is the feature-scoped public contract used inside AddFeatureState<TState>(configure).

Its staged service collection is writable during that callback and becomes read-only when the callback exits, including on failure. Complete feature registration inside the callback; retaining the feature builder does not extend its configuration lifetime.

Configure the supplied feature builder inside the callback. Add other feature states and middleware through the root before or after it; reentrant root registration is rejected before it runs. Direct parent-service changes reject the feature commit instead of being overwritten, preserving those changes while the failed feature scope closes.

Accessing the root builder's Services inside a feature callback also throws before returning the collection. This protects composite extensions, such as AddInletClient(), from partially registering parent services before a later root operation is rejected. Use the supplied feature builder's services for advanced feature configuration.

MemberPurpose
ServicesAdvanced access to the underlying IServiceCollection
AddActionEffect<TEffect>()Register a feature-scoped action effect
AddReducer<TAction>(Func<TState, TAction, TState> reduce)Register a reducer delegate
AddReducer<TAction, TReducer>()Register a reducer implementation type

Source code:

Verified Client Builder Extensions​

The current client-side extensions that build on IReservoirBuilder are:

MethodPackagePurpose
AddReservoirBlazorBuiltIns()Mississippi.Reservoir.ClientRegister both built-in navigation and lifecycle features
AddBuiltInNavigation()Mississippi.Reservoir.ClientRegister the navigation feature only
AddBuiltInLifecycle()Mississippi.Reservoir.ClientRegister the lifecycle feature only
AddReservoirDevTools(...)Mississippi.Reservoir.ClientRegister Redux DevTools integration

Source code:

Verified Ownership Boundary​

  • Store and dispatch pipeline abstractions
  • Feature state, actions, reducers, selectors, effects, and middleware
  • Client integration and testing support for that model
  • Public registration builders for top-level and feature-level composition
  • Refraction owns the Blazor UX layer.
  • Inlet owns generated full-stack alignment.

Defaults And Constraints​

This reference covers the verified subsystem boundary and the current public registration surface. See Archived Reservoir Docs for preserved deep API material that has not yet been rewritten into the active docs set.

Startup Direction​

Builder-based composition is the direction of the public Reservoir registration model going forward.

Reservoir-only application startup should begin with AddReservoir() and then compose package or feature extensions on the returned IReservoirBuilder. Full Mississippi client apps should begin with UseMississippi(...) and use client.Reservoir(...) when they need Reservoir-level composition.

Failure Behavior​

When the parent service collection is read-only, Reservoir rejects registration before invoking a new feature callback. Attempts to register through a completed parent or feature scope throw InvalidOperationException. In a full Mississippi client, terminal attachment closes the parent collection as described in Client Composition.

For runtime and API-level failure behavior, refer to the Archived Reservoir Docs and the Reservoir Concepts page.

Summary​

Use this page as the current active reference for Reservoir's builder entry points, feature-builder contracts, and verified client registration extensions.

Next Steps​