fedlarm·9개월 전·discussYou could write the logic in a more straight forward, but less composable way, so that all the logic resides in one pure function. This way you can also keep the code to only loop over the users once.email.sendBulk(generateExpiryEmails(db.getUsers(), Date.now()));
email.sendBulk(generateExpiryEmails(db.getUsers(), Date.now()));