Blazor with Fluxor: Can i have multiple instances of the same store?

459 Views Asked by At

Is there any way to have multiple instances of a store? I am actually trying to fill a grid layout with thumbnails (which contain buttons and other stuff). I want to outsource the items in a separate component, using its own instance of the same store.

I don't know if that's even a good solution. It's the only one i came up with so far. Anyone has a better idea how to solve this?

What is important to me, is that each thumbnail is loaded when its component is rendered. While it is loading it should display a loading spinner.

Screenshot of my .Net Core MVC implementation

1

There are 1 best solutions below

0
On

It's not a good approach. The purpose of the state is to exist once and be available to all.

What you need is state that holds a collection of FileState (or whatever you want to call it) which has all the info it needs, including bool IsLoading.