Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

load.ts

16 lines380 Bytes

1import type { HydrationPrefetchStrategy } from './types'
2​
3const loadType = 'load'
4​
5const loadStrategy: HydrationPrefetchStrategy<typeof loadType> = {
6 _t: loadType,
7 _d: () => false,
8 _s: ({ gate, prefetch }) => {
9 ;(prefetch ?? gate!.resolve)()
10 },
12​
13/* @__NO_SIDE_EFFECTS__ */
14export function load(): HydrationPrefetchStrategy<typeof loadType> {
15 return loadStrategy