mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-25 07:03:05 +01:00
18 lines
462 B
TypeScript
18 lines
462 B
TypeScript
import { api } from "../core/api/dynamic";
|
|
import { useAwait } from "./useAwait";
|
|
|
|
export function useTierCompare() {
|
|
const tiers = useAwait(() => api.tiers(), "tiers");
|
|
|
|
function compare(a: string, b: string) {
|
|
const [, tierNameA] = a.split(".");
|
|
const [, tierNameB] = b.split(".");
|
|
const tierA = tiers.tiers[tierNameA];
|
|
const tierB = tiers.tiers[tierNameB];
|
|
|
|
return tierB.carousel_level - tierA.carousel_level;
|
|
}
|
|
|
|
return compare;
|
|
}
|