Closed tmasnyk closed 2 months ago
Can I suggest an alternative?
Why don't you create multiple Stores, each responsible for one particular entity? This is also recommended for withEntities()
.
If you have the need to provide a single service for all three entities, you could have your three SignalStore and wrap a Service around them, which exposes each signalStore as property.
class ApplicationStore {
readonly applications = inject(ApplicationStore);
readonly links = inject(ApplicationLinksStore);
readonly groups = inject(ApplicationGroupsStore);
}
I'm going to convert this issue to a discussion.
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
I've created my own SignalStoreFeature called withEntitiesManagement, which adds an entities collection, CRUD operations, and other functionality to manage it. I want to use several such features in my store:
However, this produces a large and flat list of named methods and 'selectors', which causes noticeable freezing during IDE type fetches as well. So, I decided to slice the store to be used like this:
But there is a problem with the type limitations in the signal store:
These types don't work when I try to use them with slices, as they don't satisfy SignalStoreFeatureResult and InnerSignalStore:
To use the store with slices, the types need to be something like this:
Could the NgRx team extend these types?
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue