MCPcopy Create free account
hub / github.com/TanStack/devtools / toggleOpen

Function toggleOpen

packages/devtools/src/devtools.tsx:36–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34const themeDocumentOwners = new WeakMap<Document, Map<symbol, string>>()
35const previousThemeAttributes = new WeakMap<Document, string | null>()
36
37const setDocumentTheme = (document: Document, owner: symbol, theme: string) => {
38 let owners = themeDocumentOwners.get(document)
39 if (!owners) {
40 owners = new Map()
41 themeDocumentOwners.set(document, owners)
42 previousThemeAttributes.set(
43 document,
44 document.documentElement.getAttribute('data-tanstack-devtools-theme'),
45 )
46 }
47 owners.delete(owner)
48 owners.set(owner, theme)
49 document.documentElement.dataset.tanstackDevtoolsTheme = theme
50}

Callers 1

DevToolsFunction · 0.85

Calls 2

setPersistOpenFunction · 0.85
emitMethod · 0.45

Tested by

no test coverage detected