[+] Encapsulate method to count unread assignments

This commit is contained in:
Hykilpikonna
2019-10-05 13:10:34 -04:00
parent e422c03ca5
commit 55b4bd9173
@@ -9,4 +9,12 @@ export default class OverallCourse extends Vue
{
// @ts-ignore
@Prop({required: true}) course: Course;
/**
* Count the number of unread assignments
*/
countUnread(): number
{
return this.course.assignments.filter(a => a.unread).length;
}
}