Replies: 1 comment
-
My project has a similar situation. perhaps there is some guidance on the best practice to implement the following user story. Lets assume there is a webpage with a dropdown list of available projects to the user. when the user selects a particular project the dashboard page needs to load the state of each panel for the chosen project. Currently, there are multiple state objects one for each feature/panel and I am triggering the action to fetch data from the database for each of the corresponding states using a System.Threading.Tasks.WhenAll(). This leads to errors like "Error cloning State Microsoft.JSInterop.JSException: Byte array index '11536' does not exist. Error: Byte array index '11536' does not exist." any recommendations on a "best" approach to updating multiple states? Should I build one super large state for all features or some other pattern? |
Beta Was this translation helpful? Give feedback.
-
Hi,
Maybe I am missing a smart way of achieving the same, but here goes.
Frequently there are multiple updates to multiple states, when loading data from the server.
As part of the BlazorStateComponent(BSC) setup, many components get rerendered, multiple times, on each update/action that passes through the mediatr.
A reason for so many subscriptions is that each component registers for each state that is used (default implementation when inheriting BSC). Some components need multipe states, but only rerendering from updates to one state.
What is the best way to rethrottle this more finegrained?
I looked at the source code and considered:
I think 2 might be best, so to keep low boilerplate.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions