ngxs-labs / entity-state

⏱ WIP: Entity adapter
48 stars 12 forks source link

Behaviour of remove action #157

Closed JanMalch closed 4 years ago

JanMalch commented 5 years ago

Should the remove action remove all entities, if the payload is strictly === null or should this functionality be moved to a separate removeAll action?

markwhitfeld commented 5 years ago

Adding my comment from https://github.com/ngxs-labs/entity-state/pull/159#discussion_r330486163

I think that this is a bit dangerous to remove everything if the payload is null. I would have expected it to remove nothing if the payload was missing. Maybe we should have a separate removeAll so that the action is explicit?

JanMalch commented 5 years ago

@philly-vanilly @kuhnroyal @cblaettl Do you have any opinion / insight on this topic?

cblaettl commented 5 years ago

I have no idea why I was tagged here, but I'm agreeing with Mark.

JanMalch commented 5 years ago

Saw you participating in another thread and I figured you are already using this library and might have some insight

JanMalch commented 5 years ago

Working on it right now and will add a removeAll action. @markwhitfeld Update has the same behaviour. Both use the EntitySelector. Should it be updated aswell?