UNPKG

@vtex/api

Version:
8 lines (7 loc) 383 B
import { MiddlewareContext } from '../typings'; export type Memoized = Required<Pick<MiddlewareContext, 'cacheHit' | 'response'>>; interface MemoizationOptions { memoizedCache: Map<string, Promise<Memoized>>; } export declare const memoizationMiddleware: ({ memoizedCache }: MemoizationOptions) => (ctx: MiddlewareContext, next: () => Promise<void>) => Promise<void>; export {};