Show the Company Name of the Teachers and students that are linked in the User List View
This commit is contained in:
@@ -9,6 +9,24 @@ export function dateSorter(a: any, b: any, direction: "asc" | "desc", key: strin
|
||||
return 0;
|
||||
}
|
||||
|
||||
export async function asyncSorter<T>(array: T[], sorterFunction: (a: T, b: T) => Promise<number>): Promise<T[]> {
|
||||
let swapped = false;
|
||||
do {
|
||||
swapped = false;
|
||||
for (let i = 0; i < array.length - 1; i++) {
|
||||
const result = await sorterFunction(array[i], array[i + 1]);
|
||||
if (result < 0) {
|
||||
const aux = array[i + 1];
|
||||
array[i + 1] = array[i];
|
||||
array[i] = aux;
|
||||
swapped = true;
|
||||
}
|
||||
}
|
||||
} while (swapped);
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
export function env(key: string) {
|
||||
return (window as any).__ENV[key];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user