Replies: 1 comment
-
Sorted entities can be defined as a computed signal: type SortOrder = 'asc' | 'desc';
const UsersStore = signalStore(
withState({ sortOrder: 'asc' as SortOrder }),
withEntities<User>(),
withComputed(({ sortOrder, entities }) => ({
sortedUsers: computed(() => [...entities()].sort(/* ... sorting logic ... */)),
})),
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
The basic store
createEntityAdapter
supports a sort-comparer, which would be nice to have in Signal-StorewithEntities
as well.Describe any alternatives/workarounds you're currently using
New option for
entityConfig
and make collection optional if not required.I would be willing to submit a PR to fix this issue
Beta Was this translation helpful? Give feedback.
All reactions