deno.land / x / solid@v1.5.6 / src / render / hydration.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export type HydrationContext = { id: string; count: number; };
type SharedConfig = { context?: HydrationContext; resources?: { [key: string]: any }; load?: (id: string) => Promise<any> | any | undefined; gather?: (key: string) => void; registry?: Map<string, Element>; done?: boolean;};
export const sharedConfig: SharedConfig = {};
export function setHydrateContext(context?: HydrationContext): void { sharedConfig.context = context;}
export function nextHydrateContext(): HydrationContext | undefined { return { ...sharedConfig.context, id: `${sharedConfig.context!.id}${sharedConfig.context!.count++}-`, count: 0 };}
solid

Version Info

Tagged at
a year ago