- Garcia's Guide to the Galaxy
- Posts
- Fluxor for Dummies
Fluxor is a Flux implementation for Blazor in the vein of Redux. It is a state management system designed for larger software systems that encourages immutability of state, pure functions and clean separation of code. Given my fairly basic understanding of the Flux pattern I thought it would be valuable to document what it is at a high level and what’s required when using Fluxor to implement the various concepts.
Note that this is not a tutorial on Flux or Fluxor, both of those are covered quite nicely in the Fluxor Documentation already. This is my attempt to distill the two into a form that I at least will find useful to refer to. For more detailed implementation information, refer to the aforementioned tutorials.
[FeatureState]
attribute.static
to encourage pure functions, and have the [ReducerMethod]
attribute in Fluxor.[EffectMethod]
attribute in Fluxor.IActionSubscriber
) that intercepts actions independent of the store.Fluxor.Blazor.Web.Components.FluxorComponent
.
StateChanged
event and execute InvokeAsync(StateHasChanged)
. Don’t forget to unsubscribe!As an example, the CLI tutorial given on Fluxor’s docs does the following:
I’ve taken note of this as I particularly like the way the initial action is used to update the state by way of a reducer while also triggering the effect to load the data.
Certainly a person
© Copyright 2023
Phil Watson
Last updated
Thursday, 09/Nov/2023 14:20 AEST