diff --git a/src/lib/server.ts b/src/lib/server.ts index 5c0bbca..717627d 100644 --- a/src/lib/server.ts +++ b/src/lib/server.ts @@ -19,19 +19,19 @@ export const flashCookieOptions: CookieSerializeOptions = { /** * @deprecated Renamed to loadFlash. */ -export function loadFlashMessage(cb: S) { - return loadFlash(cb); +export function loadFlashMessage(load: (event: E) => R) { + return loadFlash(load); } /** * Retrieves the flash message from the previous request. * Use as a wrapper around a top-level load function, usually in a +layout.server.ts file. */ -export function loadFlash(cb: S) { +export function loadFlash(load: (event: E) => R) { return async (event: E) => { const flash = _loadFlash(event).flash; - const loadFunction = await cb(event); - return { flash, ...loadFunction } as ReturnType; + const loadReturn = await load(event); + return { flash, ...loadReturn } as typeof loadReturn; }; }