Closed djjohnson-net closed 2 years ago
opts.WithLifetime(StoreLifetime.Singleton)
in services.AddFluxor(opts => .........)
will do it
Thanks for the suggestion. Does that make all the State objects as Singletons? I'm looking for a solution that will allow me to use Scoped and Singletons depending on how I need them to work.
This would make everything a singleton.
Fluxor is supposed to be used for single-user state synchronisation. I wouldn't recommend it for multi-users in this way.
There is a library that I can't currently remember the name of that does a kind of Flux pattern but for server apps. You might get the name if you ask in https://gitter.im/aspnet/Blazor
I have been looking all over to find an example of using Fluxor State as a Singleton. Can someone direct me in the right direction? (I'm using Blazor Server)I would like the state to be shared across the whole app including users. That's why I'm thinking Singleton. Maybe there is a better way with Fluxor? Any suggestions...