-
Notifications
You must be signed in to change notification settings - Fork 18
Better support for extending NgxsDataEntityCollectionsRepository #360
Comments
Give examples of expected behavior so that I can implement this |
I will put together a minimal example of what we're trying to achieve later today. |
Let's say we wanted additional properties in our EntityCollectionsReducer like
In order to get this working, there would be a few things we need to adjust. The most important is a new class type generic:
Then we could simply use this in our Collection:
There might be another caveat... for all the operations used in NgxsDataEntityCollectionsRepository, the rest of the state would need to be persisted. So
If this is hard to follow along, I can make an example repository with the overrides in place. Edit: |
I understand you, yes, I think no problem will add this soon |
move to Entity.md |
released in |
We recently switched from ngrx to nxgs with an app that heavily used ngrx/data. Right now we are trying to automate crud operations with our api in a similar way we did with ngrx/data. The route we've chosen is to extend NgxsDataEntityCollectionsRepository to include
getAll
getOne
etc. for now.Just to share what we are experiencing so far: If we are adding custom fields to the NgxsDataEntityCollectionsRepository reducer, we need to override
get snapshot()
andgetState()
. It'd be very nice, if there could be a third generic allowing to specify a type for theNgxsEntityCollections
.The text was updated successfully, but these errors were encountered: