[U] Cache assignments()
This commit is contained in:
+4
-6
@@ -167,17 +167,15 @@ export default class Course
|
|||||||
return this.computed.termAssignments[timeCode];
|
return this.computed.termAssignments[timeCode];
|
||||||
}
|
}
|
||||||
|
|
||||||
private _cacheAssignments: Assignment[];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get graded assignments
|
* Get graded assignments
|
||||||
*/
|
*/
|
||||||
get assignments(): Assignment[]
|
get assignments(): Assignment[]
|
||||||
{
|
{
|
||||||
if (this._cacheAssignments == null)
|
return this.cache.get('Assignments', () =>
|
||||||
this._cacheAssignments = this.rawSelectedAssignments.filter(a => a.complete == 'Complete');
|
{
|
||||||
|
return this.rawSelectedAssignments.filter(a => a.complete == 'Complete');
|
||||||
return this._cacheAssignments;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _cacheLetterGrade: string;
|
private _cacheLetterGrade: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user