How to remove elements filetered from an array?

Let’s say I have a store with an array of items, and those items have property selected

I want to remove all the elements that are selected when a button is clicked.
I used a filter to get all the element that are selected, but how to remove them, then?

Well, you just have to think the other way around, you want to keep the elements that are NOT selected.
So the first part is to filter the element that are not selected, and then update your array directly in your store!

1 Like