Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "neogarden", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -13,3 +13,7 @@ import { getClient } from "./getClient"; | ||
export async function loadPage({ request, params, fetchLinks = '' }) { | ||
async function emptyAsync() { | ||
return null; | ||
} | ||
export async function loadPage({ request, params, fetchLinks = "", loaders }) { | ||
const client = getClient(); | ||
@@ -36,3 +40,12 @@ const config = getConfig(); | ||
} | ||
return getPage(route, client, parsed, options); | ||
const page = await getPage(route, client, parsed, options); | ||
const additionalData = await Promise.all( | ||
page.data.body.map((slice) => | ||
(loaders[slice.slice_type] || emptyAsync)(slice) | ||
) | ||
); | ||
for (let i = 0; i < page.data.body.length; i += 1) { | ||
page.data.body[i].loaderData = additionalData[i]; | ||
} | ||
return page; | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5168
153