A library that provides Redux-style state management for Blazor applications, enabling predictable state containers with C# and F# support.
Blazor Redux is a library that connects a Redux state store with Blazor, enabling Redux-style state management in .NET-based web applications. It provides a unidirectional data flow architecture, where application state is kept in a single store and updated via reducers and actions. This approach facilitates features like time-travel debugging, undo/redo, and state hydration, making Blazor applications more predictable and easier to debug.
Developers building Blazor applications who want predictable state management, especially those familiar with Redux patterns or looking to leverage strong typing and immutability in C# or F#.
Developers choose Blazor Redux because it brings the proven Redux architecture to Blazor, offering automatic component updates, Redux DevTools integration, and support for both C# and F#. It enhances Blazor's capabilities with a more robust state management model compared to vanilla Blazor's two-way data binding.
Connecting a Redux state store with Blazor.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Blazor components automatically re-render when the Redux store changes, eliminating the need for manual StateHasChanged() calls, as stated in the README under advantages over vanilla Blazor.
Enables time-travel debugging, state monitoring, and hot reload-like state persistence, compatible with standard Redux DevTools for enhanced debugging, illustrated in the README with a gif and configuration steps.
Leverages .NET's strong type system, with F# support for discriminated unions and record types, ensuring type-safe actions and immutable state, highlighted in the README's sections on designing types and actions.
Synchronizes routing with application state, allowing consistent navigation during time-travel debugging, as configured in Program.cs with location reducers and getters.
The project is at an experimental stage with expected breaking changes, as noted in the contributing section, making it risky for production use without careful version management.
Using F# requires additional JSON serialization libraries like Chiron and configuration for state deserialization, adding setup overhead and dependencies, as explained in the Redux DevTools and action creators sections.
Blazor projects and Razor pages must be written in C#, even when using F# for types and reducers, limiting language flexibility and forcing a mixed-language approach, as mentioned in the F# advantages section.