You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @ngneat/elf-* package(s) are relevant/releated to the feature request?
entities
Description
I want to store various entities in my store and keep them ordered by a given key, or even better a comparator function, so that subscribers can receive the collection in the expected order, even if I do multiple removals and insertions.
However, entities are kept in the same sequence as their insertion order (except if one uses the prepend option), and thus served in the same order to subscribers.
Which @ngneat/elf-* package(s) are relevant/releated to the feature request?
entities
Description
I want to store various entities in my store and keep them ordered by a given key, or even better a comparator function, so that subscribers can receive the collection in the expected order, even if I do multiple removals and insertions.
However, entities are kept in the same sequence as their insertion order (except if one uses the
prepend
option), and thus served in the same order to subscribers.Proposed solution
Sort key
Sort function
Alternatives considered
Sort at subscriber level
Of course, I can do the sorting at each subscriber level, but this means:
Sort and update all entities
moveEntity
This implies moving entities one-by-one, and feels cumbersome.
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: