I'm novice with using Blazor and Fluxor, and I trying to deside what is better to use
IActionSubscriber - manually inject, subscribe and unsubscribe
or
inherit FluxorComponent - and use the ActionSubscriber
What is the best solution? What is benefits and disadvantages?
Inheriting from
FluxorComponenthas a couple of advantages, in that you don't need to manually callStateHasChangedall the time and you don't have to inject theIActionSubscriber, as it in included for free, and you don't have to remember to unsubscribe on disposing the component.Functionality-wise, I don't think there's any difference, except that the
FluxorComponenttakes care of some work for you.The only disadvantage I can think of is if inheriting from
FluxorComponentkeeps you from inheriting from another base component class.As for myself, I just inherit from
FluxorComponentand go. It's working very well.