Skip to content

Commit

Permalink
fix: make useConfig() work for vike-solid hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Aug 21, 2024
1 parent 1a27788 commit addbecd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vike-solid/utils/callCumulativeHooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
export async function callCumulativeHooks(values: undefined | unknown[], pageContext: unknown): Promise<unknown[]> {
export { callCumulativeHooks };

import { providePageContext } from "vike/getPageContext";

async function callCumulativeHooks(
values: undefined | unknown[],
pageContext: Record<string, any>,
): Promise<unknown[]> {
if (!values) return [];
const valuesPromises = values.map((val) => {
if (typeof val === "function") {
providePageContext(pageContext);
// Hook
return val(pageContext);
} else {
Expand Down

0 comments on commit addbecd

Please sign in to comment.