I am using React and Redux. I have a store of items like {name: 'Jim', votes: '5', type: 'candidate'}
I am using reselect to get a filtered list of items. I am also using reselect to sort this list of items by votes.
When an item is voted it will automatically change position in the list (item changes, reselect does its job and reorder the list).
I would like to prevent this behavior. Is that possible without re-ordering inside the state?
Another approach might consist of generating the sorting information during data normalization or items initialization. You might keep the information into a separate array or just push a
sorting
propery into each item object.In that way updating the score wouldn't interfere with item sorting.