Closed JourdanClark closed 2 years ago
I'd just register a singleton service for that kind of functionality.
services.AddSingleton<MyService>()
You can then inject that into effects and whatnot.
I think I removed it, but I don't recall why. Someone is in the process of creating a PR that will enable you to register everything as Singleton instead of Scoped. The primary purpose of this is for MAUI apps. It would work in multi-user scenarios too, but you'd be sharing everything Fluxor related.
Hello,
I have a use case where I have some states which should essentially be static and shared across sessions. This would majorly reduce overhead and improve performance. If I have 10 connections to my Blazor application, I would like all of them to be interacting with the same state instance. Ideally, I would like to initialize this state object on the backend and update it from the server even when no active connections are present, while also allowing active connections to update the state.
I saw in an old Reddit post that
.UseSingletonDependencyInjection()
was added to3.9.0-beta-1
, but I'm not seeing that in the current version.Is it possible to do what I'm looking for, or should I come up with another approach?
Note: Not all states should be static.
Thanks