Closed 240026763 closed 1 year ago
Hi Jeremy, that makes total sense and sounds like a good idea to me. If you have time to make a PR for this change you'll find I'm pretty open to help :)
Sounds good, I'll put something together. You mind if I update the packages to the latest and target net7?
That'd be great thanks! Just fire up the sample project and make sure it doesn't look broken after.
Thanks for merging the PR. It works great!
Is your feature request related to a problem? Please describe. I'm using LocalStorage to persist my data and I've got an issue where I need a certain feature's state to be loaded before any others because it is used in the key of the others. Example: ZState needs to load before "LastUserSelectionState" because I'm storing things with keys like: "{authorized user}\{ZState.Value}\{LastUserSelection.Value}".
Currently, the features are loaded in alphabetical order by feature type full name. So ZState would load after LastUserSelection and therefore doesn't load LastUserSelection correctly.
Describe the solution you'd like It would be great to have a feature priority level attribute. If I have a [FeatureState] class or record, I could have another attribute like [FeatureState, PriorityLoad(1)] where "1" denotes the priority level highest (1) to lowest (int max value).
Describe alternatives you've considered The only other solution I can think of here is to name them alphabetically to prioritize them which is a naming convention snafu and a special rule that has to be remembered/documented.
Additional context The issue code: https://github.com/Tailslide/fluxor-persist/blob/a2311c6d645f58d5e88ebfb9903cfa3a79ba9888/Fluxor.Persist/Middleware/PersistMiddleware.cs#L72