I am using the RevalidatingServerAuthenticationStateProvider to tirgger a refresh of an access token in blazor.
I would like to inject the IDispatcher from Fluxor, in order to dispatch new tokens once the new access code has been generated.
I cannot inject IDispatcher in to the class
If I inject in to the constructor, blazor starts with a blank screen and no error is reported.
Using the [Inject] attribute just results in a null property.
Note: I can inject IDispatcher elsewhere and is used, and it is registered in DI.
Any advice on how to dispatch a message from inside?
Im using blazor server if that makes any difference.
My guess is that you are not registering your class with Dependency Injection container.
Example of
Startup.cs
Then you can use like so
razor
c#
If you need to do it in the component's scope, you can do something like this
Check out Microsoft docs for more info