{"version":3,"file":"setContext.cjs","names":["useGlobalContext"],"sources":["../../src/GlobalContext/setContext.ts"],"sourcesContent":["import { useGlobalContext } from './useGlobalContext';\n\n/**\n * Writes one value into the active {@link GlobalContext}.\n *\n * This helper reads React context internally, so call it during a component or\n * custom hook render path.\n *\n * Components reading the same key through {@link getContext} will re-render when\n * the reactive value changes.\n *\n * @typeParam T - Value type.\n * @param key - Context key to update.\n * @param value - Value to store.\n *\n * @example\n * ```tsx\n * function StatusWriter({ ready }: { ready: boolean }) {\n *   setContext('status', ready ? 'ready' : 'idle');\n *   return null;\n * }\n * ```\n */\nexport function setContext<T = any>(key: string, value: T): void {\n  const globalContext = useGlobalContext();\n  globalContext[key] = value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,WAAoB,KAAa,OAAgB;CAC/D,MAAM,gBAAgBA,uCAAAA,iBAAiB;CACvC,cAAc,OAAO;AACvB"}