UNPKG

create-vanjs

Version:

🍦 Quick tool for scaffolding your first VanJS project

13 lines (9 loc) 351 B
import van from "vanjs-core"; import type { PageContext } from "../types/types"; export const CurrentPageContext = van.state<Partial<PageContext>>({}); export const usePageContext = () => { return CurrentPageContext.val; }; export const setPageContext = <T extends PageContext>(newContextVal: T) => { CurrentPageContext.val = newContextVal; };