Skip to content

Commit 93ab7ef

Browse files
update util jsdocs
1 parent 331e6e6 commit 93ab7ef

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lib/utils.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ export function cn(...inputs: ClassValue[]) {
2020
return twMerge(clsx(inputs));
2121
}
2222

23-
// https://react.dev/reference/react/cache#caveats
24-
// > React will invalidate the cache for all memoized functions for each server request.
23+
/**
24+
* Get the app configuration
25+
* @param headers - The headers of the request
26+
* @returns The app configuration
27+
*
28+
* @note React will invalidate the cache for all memoized functions for each server request.
29+
* https://react.dev/reference/react/cache#caveats
30+
*/
2531
export const getAppConfig = cache(async (headers: Headers): Promise<AppConfig> => {
2632
if (CONFIG_ENDPOINT) {
2733
const sandboxId = SANDBOX_ID ?? headers.get('x-sandbox-id') ?? '';
@@ -70,9 +76,11 @@ export const getAppConfig = cache(async (headers: Headers): Promise<AppConfig> =
7076
return APP_CONFIG_DEFAULTS;
7177
});
7278

73-
// check provided accent colors against defaults
74-
// apply styles if they differ (or in development mode)
75-
// generate a hover color for the accent color by mixing it with 20% black
79+
/**
80+
* Get styles for the app
81+
* @param appConfig - The app configuration
82+
* @returns A string of styles
83+
*/
7684
export function getStyles(appConfig: AppConfig) {
7785
const { accent, accentDark } = appConfig;
7886

0 commit comments

Comments
 (0)