CI / Generate TypeScript types (push) Successful in 12s
CI / Server unit tests (push) Successful in 26s
CI / Build server (push) Successful in 32s
CI / Build client (push) Successful in 41s
CI / Playwright E2E tests (push) Successful in 1m47s
CI / Build and push Docker image (push) Successful in 49s
CI / Notify (push) Successful in 2s
13 lines
542 B
TypeScript
13 lines
542 B
TypeScript
import { useSyncExternalStore } from "react";
|
|
import { getAppConfig, getGroupLimits, subscribeAppConfig } from "../utils/appConfig";
|
|
|
|
/** Aktuální limity skupinových objednávek (překreslí se po načtení konfigurace ze serveru). */
|
|
export function useGroupLimits() {
|
|
return useSyncExternalStore(subscribeAppConfig, getGroupLimits);
|
|
}
|
|
|
|
/** Celá runtime konfigurace ze serveru (způsob přihlášení, zapnuté funkce, limity). */
|
|
export function useAppConfig() {
|
|
return useSyncExternalStore(subscribeAppConfig, getAppConfig);
|
|
}
|