removeAll resets the state to its initial value instead of removing all entities
krtek4 opened this issue · 4 comments
krtek4 commented
From the documentation :
state.removeAll() | void | Remove all entities from the collection
But if we look at the code :
@DataAction()
public removeAll(): void {
this.setEntitiesState(this.initialState);
}
My understanding is that "Remove all entities from the state" will only clear the entities attribute of the state and not reset the state to its initial value.
Also, this is misleading if the initialState contains entities, removeAll
would then "leave" entities in the state.
krtek4 commented
I recreated this from ngxs-labs/data#647 since it wasn't migrated here