Closed mxdmedia closed 4 years ago
Implementation Proposal
Add the following actions: DeleteByKey, DeleteByKeySuccess, DeleteByKeyFailure DeleteManyByKeys, DeleteManyByKeysSuccess, DeleteManyByKeysFailure
Add corresponding effect operators (projects/ngrx-auto-entity/src/lib/operators.ts
)
Add corresponding methods to NgrxAutoEntityService
(projects/ngrx-auto-entity/src/lib/service.ts
)
Add corresponding methods to interface IAutoEntityService
(projects/ngrx-auto-entity/src/lib/service.ts
)
Add corresponding cases to reducer (projects/ngrx-auto-entity/src/lib/reducer.ts
)
Add corresponding support in @Entity (projects/ngrx-auto-entity/src/lib/decorators/entity.ts
)
Expose public members through projects/ngrx-auto-entity/src/lib/index.ts
Add necessary unit tests
One feature (that seems would be somewhat easy to implement) that would be quite convenient, is the ability to remove entities from the store with only an id. Currently in order to delete an entity or entities, I am doing the following:
However, this requires that I already have the entity or entities I want to delete. My problem there also goes back to my frequent use of child/parent relationships. There are many times I'd like to delete, say, all of the children of a given parent, but in the current view I only have a list of child ids. It would be great to be able to do something like:
rather than having to go fetch an entity or entity array in order to remove.