array remove by predicate should be implemented
Closed this issue · 4 comments
fehergeri13 commented
I use this pattern so often:
myObservableArray.replace(myObservableArray.filter(item => item.bad !== true));
so I think it should be implemented by default.
myObservableArray.removeAll(item => item.bad === true)
mweststrate commented
Ehh.. it exists already?
Op ma 20 nov. 2017 om 15:14 schreef Gergely Fehérvári <
notifications@github.com>:
… I use this pattern so often:
myObservableArray.replace(myObservableArray.filter(item !== value));
so I think it should be implemented by default.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1248>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhM56vksis-rOVBjGCGSiX26Xhjlgks5s4YlMgaJpZM4QkUmI>
.
fehergeri13 commented
Meh, not really. because currently only item match is existing but this is kinda different, since i want to use a predicate. Maybe not only I item exists which I want to remove. I updated my ticket, to describe my request better.
mweststrate commented
Feel free to submit a PR :) removeAll
sounds like a sane name
mweststrate commented
Closed, see: #1384 (comment)