Add error logs for server functions. Add cache dynamic function.
This commit is contained in:
Vendored
+13
-2
@@ -188,7 +188,10 @@ export type BunextPageServerFn<T extends {
|
||||
[k: string]: any;
|
||||
}> = (ctx: Omit<BunxRouteParams, "body">) => Promise<BunextPageModuleServerReturn<T>>;
|
||||
export type BunextRouteConfig = {
|
||||
cachePage?: boolean;
|
||||
/**
|
||||
* Whether to cache the current page
|
||||
*/
|
||||
cachePage?: BunextCachePageType;
|
||||
/**
|
||||
* Expiry time of the cache in seconds
|
||||
*/
|
||||
@@ -207,13 +210,21 @@ export type BunextPageModuleServerReturn<T extends {
|
||||
query?: Q;
|
||||
redirect?: BunextPageModuleServerRedirect;
|
||||
responseOptions?: ResponseInit;
|
||||
cachePage?: boolean;
|
||||
/**
|
||||
* Whether to cache the current page
|
||||
*/
|
||||
cachePage?: BunextCachePageType;
|
||||
/**
|
||||
* Expiry time of the cache in seconds
|
||||
*/
|
||||
cacheExpiry?: number;
|
||||
url?: BunextPageModuleServerReturnURLObject;
|
||||
error?: string;
|
||||
};
|
||||
export type BunextCachePageType = boolean | ((params: {
|
||||
ctx: Omit<BunxRouteParams, "body">;
|
||||
serverRes?: BunextPageModuleServerReturn;
|
||||
}) => Promise<boolean> | boolean);
|
||||
export type BunextPageProps<T extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
|
||||
Reference in New Issue
Block a user