Is there a Programmatic Alternative to <Fluxor.Blazor.Web.StoreInitializer /> in App.razor? #365
-
Hi, I have plans to work heavily with Fluzor in Blazor but I have hit a snag. All my Blazor components are in the form of dynamically loaded standalone RCL (Razor Component Libraries) that get loaded into an existing Blazor framework (see Oqtane here on GitHub). The issue in a nutshell is I don't have access to the framework's App.razor file. So I can't add the requisite <Fluxor.Blazor.Web.StoreInitializer /> to it to initialize the store. By the time my RCL is loaded dynamically by the Oqtane framework the Blazor app is already up and running. Oqtane's framework supports calling into the RCL Modules's IServerStartup class providing the IServiceCollection so I am able to provide the dependecies that my module requires - in this case Fluzor: // Oqtane framework automatically calls the ConfigureServices() method for all classes implementing IServerStartup
The issue occurs when my Blazor razor component Oqtane Module attempts to render: There is no registered service of type 'Fluxor.IState`1[MyFluxorModuleState]'. How can I perform the equivalent of what <Fluxor.Blazor.Web.StoreInitializer /> does for me in the App.razor, programmatically at the time of dependency injection in the routine above? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi That component does the following
I think you should be fine injecting IStore and only performing step 3. |
Beta Was this translation helpful? Give feedback.
Hi
That component does the following
I think you should be fine injecting IStore and only performing step 3.