overleaf/services/web/frontend/stories/hooks/use-meta.tsx
Alf Eaton d91ee50762 Standardise scope/context usage in Storybook stories (#7842)
GitOrigin-RevId: 109a4357fc3b083ffbd3af5b8c98acf0f655f297
2022-05-17 08:04:12 +00:00

8 lines
248 B
TypeScript

/**
* 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)
}
}