DEV Community

Discussion on: Advanced Blazor State Management Using Fluxor, part 6 - Persisting State

mr_eking profile image
Eric King Author

Thanks Christian.

It seems to me that there would be very limited value in a generic SuccessAction or FailureAction. Wouldn't you want to know what failed or succeeded, so you could react appropriately? If you only had a generic SuccessAction, then to know what succeeded you would need a payload of some sort identifying the Action that succeeded. To react to a particular success, you would have to handle the generic SuccessAction, which means processing every success and deciding whether to act on it by inspecting the payload.

I would much rather dispatch a specific XYZSuccessAction and be able to react to that specific action if necessary.

There's no reason you can't also dispatch a generic SuccessAction if you wish to do something generic upon every success, but I can't think of a reason I'd want to do that at the moment.