Avoid dispatching range changed events if there's nothing to be gained.

This commit is contained in:
Dermot Duffy
2023-01-30 20:21:12 -08:00
parent 93e8a8e71b
commit f9f2a494c6
4 changed files with 47 additions and 7 deletions
+10 -1
View File
@@ -181,4 +181,13 @@ export const dayToDate = (day: string): Date => {
// Must provide the hour:minute:second on parsing or Javascript will assume
// *UTC* midnight.
return new Date(`${day}T00:00:00`);
}
};
export const isSuperset = (superset: Set<unknown>, subset: Set<unknown>) => {
for (const item of subset) {
if (!superset.has(item)) {
return false;
}
}
return true;
};