-
Notifications
You must be signed in to change notification settings - Fork 59
Description
What would you like to be added:
I would like to have a object or numeric identifyier per ListState/ListFeed Item, to know on which position this Item is, without having to insert such Property into an eventual Record type definition (not working for simple types!) and having to update ALL Items all the time, just to have this workaround identifier up to date
Why is this needed:
(for simplification, I will use ListState for both MVUX Collection kinds, but meaning them both!)
A ListState for example does encapsulate its Value Type in a IImmutableList<T> and in case we might have multiple equal items on different positions inside of this List, we do not have the possibility to check this without one of this workarounds:
- (currently used) iterating over the ListState using e.g.
await MyListState.Value(ct:token);-> which will return the wholeIImmutableList<T>where you then have at least a numeric List default Identifyer - Creating a Record Definition to encapulate this and change ALL of the items in the ListState each time. Definition could be like
MyRecord(int Id, string SimpleTypeData). This approach would, as you might notice, just destroy the whole Immutability we are getting from Mvux 👀 - Maybe but really complicated since we are by that loosing the whole ListState methods(!) using
State<IImmutableDictionary<T>>which would then enable us maybe to have a non-numeric identifyer if our data maybe require this
Sample Szenario
For example, if you have a ListState like described:
[
Item1,
Item2,
Item3,
Item4,
Item5
]
and lets say 2 and 4 would be equal.
now your User might have selected the Item4 and you want to remove ALL items after this (transferable to selection of Item2 etc) you have no way to know the position of this one you got selected.
For which Platform:
- All Platforms
Anything else we need to know?
- asked for a out of the Box DictionaryState in - [Mvux][ListState] Can we get a DictionaryState beside a ListState using a ReactiveDictionary? #2709 - but seems like this is far from considered because this not even got an respond from the team... Would be an important Feature to have in Business applications. I would for exampla have needed this in both of my past Applications at work🫤