Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Last active October 11, 2022 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajcrites/29089473f8a0962a82e55e80e3fd8ba5 to your computer and use it in GitHub Desktop.
Save ajcrites/29089473f8a0962a82e55e80e3fd8ba5 to your computer and use it in GitHub Desktop.
export class SpecialsService {
specials: [Special] = [{} as Special];
...
async deleteStaleSpecials() {
try {
this.specials.forEach(async (special) => {
if (special.stale) {
await this.deleteSpecial(special);
}
});
} catch (err) {
console.error('An error occurred deleting a special', err);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment