lundi 11 juillet 2016

Destroy all records that have the checked property equal to true

I'm using the following code to destroy records that have the checked property equal to true:

destroyRecords(model) {
  model.forEach((item) => {
    if (item.get('checked')) {
      item.destroyRecord();
    }
  });
}

Seems bad for performance check each one. Isn't there a better approach?

Thanks.




Aucun commentaire:

Enregistrer un commentaire