// Use this for passing state between pages implicitly const state = new Map() export const setKey = (key: string, value: T) => state.set(key, value) export const getKey = (key: string) => state.get(key) as T | undefined export const popKey = (key: string) => { const value: T | undefined = state.get(key) state.delete(key) return value }