overleaf-cep/services/web/frontend/stories/hooks/use-meta.tsx
Alf Eaton 604471bfe9 Improve types for window.metaAttributesCache (#22983)
GitOrigin-RevId: cc962bf7eeaac525267ba04080889b0d58051914
2025-01-23 09:05:14 +00:00

10 lines
301 B
TypeScript

import { PartialMeta } from '@/utils/meta'
/**
* Set values on window.metaAttributesCache, for use in Storybook stories
*/
export const useMeta = (meta: PartialMeta) => {
for (const [key, value] of Object.entries(meta)) {
window.metaAttributesCache.set(key as keyof PartialMeta, value)
}
}