overleaf/services/web/frontend/stories/hooks/use-meta.tsx

9 lines
248 B
TypeScript
Raw Normal View History

/**
* Set values on window.metaAttributesCache, for use in Storybook stories
*/
export const useMeta = (meta: Record<string, unknown>) => {
for (const [key, value] of Object.entries(meta)) {
window.metaAttributesCache.set(key, value)
}
}