Type Alias GetLoadContextFunction<Env, Params, Data>
GetLoadContextFunction<Env, Params, Data>: ((args: { context: { cloudflare: EventContext<Env, Params, Data> & { caches: CacheStorage; cf: EventContext<Env, Params, Data>["request"]["cf"]; ctx: { passThroughOnException: EventContext<Env, Params, Data>["passThroughOnException"]; waitUntil: EventContext<Env, Params, Data>["waitUntil"]; }; }; }; request: Request; }) => AppLoadContext | Promise<AppLoadContext>) Type Parameters
- Env = unknown
- Params extends string = any
- Data extends Record<string, unknown> = Record<string, unknown>
A function that returns the value to use as
context
in routeloader
andaction
functions.You can think of this as an escape hatch that allows you to pass environment/platform-specific values through to your loader/action.