Closed brandonroberts closed 3 months ago
The load resolver can be called from within another resolver by accessing it through the route config.
load
export const routeMeta: RouteMeta = { resolve: { data: async(route) => { // call server load resolver for this route from another resolver const data = await route.routeConfig?.resolve?.['load']?.(route); return { ...data }; } } }
We can add a utility function for this named getLoadResolver and use it as getLoadResolver(route).
getLoadResolver
getLoadResolver(route)
import { getLoadResolver } from '@analogjs/router'; export const routeMeta: RouteMeta = { resolve: { data: async(route) => { // call server load resolver for this route from another resolver const data = await getLoadResolver(route); return { ...data }; } } }
Originally posted by @brandonroberts in https://github.com/analogjs/analog/issues/1039#issuecomment-2069965764
Hello @brandonroberts, can you assigned me to this task please ?
@Tenessy yep, thanks!
Closed by https://github.com/analogjs/analog/pull/1144 and released in 1.5.0
1.5.0
The
load
resolver can be called from within another resolver by accessing it through the route config.We can add a utility function for this named
getLoadResolver
and use it asgetLoadResolver(route)
.Originally posted by @brandonroberts in https://github.com/analogjs/analog/issues/1039#issuecomment-2069965764