Managing Application State
In this chapter, we will explore the crucial aspect of maintaining and manipulating the state of a Blazor application. An application state is the runtime data that dictates the behavior and appearance of an application, reflecting user interactions and decisions.
We will walk through various strategies for state management, from encoding state in the URL for bookmarkable states and easy sharing to implementing in-memory state containers for rapid access. You’ll learn how to inject application state as a service, allowing centralized state management across different components, and how to persist state to ensure data continuity across sessions. Furthermore, we will explore techniques to resolve persisted state upon application load, invoking state changes from anywhere within an application, and monitoring these changes with dedicated listening components. We will pay special attention to sharing state across different render mode boundaries.
...