MCPcopy Index your code
hub / github.com/21st-dev/1code / WindowProvider

Function WindowProvider

src/renderer/contexts/WindowContext.tsx:5–15  ·  view source on GitHub ↗
({ children }: { children: React.ReactNode })

Source from the content-addressed store, hash-verified

3const WindowContext = createContext<string>("default")
4
5export function WindowProvider({ children }: { children: React.ReactNode }) {
6 const windowId = useMemo(() => {
7 return getWindowId()
8 }, [])
9
10 return (
11 <WindowContext.Provider value={windowId}>
12 {children}
13 </WindowContext.Provider>
14 )
15}
16
17export function useWindowId(): string {
18 return useContext(WindowContext)

Callers

nothing calls this directly

Calls 1

getWindowIdFunction · 0.85

Tested by

no test coverage detected