MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / JsonDocProvider

Function JsonDocProvider

app/hooks/useJsonDoc.tsx:13–29  ·  view source on GitHub ↗
({
  children,
  doc,
  path,
  minimal,
}: {
  children: ReactNode;
  doc: JSONDocument;
  path?: string;
  minimal?: boolean;
})

Source from the content-addressed store, hash-verified

11const JsonDocContext = createContext<JsonDocType | undefined>(undefined);
12
13export function JsonDocProvider({
14 children,
15 doc,
16 path,
17 minimal,
18}: {
19 children: ReactNode;
20 doc: JSONDocument;
21 path?: string;
22 minimal?: boolean;
23}) {
24 return (
25 <JsonDocContext.Provider value={{ doc, path, minimal }}>
26 {children}
27 </JsonDocContext.Provider>
28 );
29}
30
31export function useJsonDoc(): JsonDocType {
32 const context = useContext(JsonDocContext);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected