2026-09-12 13:45:10 +00:00
|
|
|
// Module ID: 7531
|
|
|
|
|
// Function ID: 7532
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: ContextUtils
|
2026-07-29 08:29:29 +00:00
|
|
|
// Dependencies: [19, 21, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-12 13:45:10 +00:00
|
|
|
// Module 7531 (ContextUtils)
|
2026-09-10 05:38:07 +00:00
|
|
|
import noop from "module_19" /* 19 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const jsx = fn(21).jsx;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("utils/ContextUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function createDefinedContext() {
|
2026-07-23 10:11:24 +00:00
|
|
|
context = context.createContext(undefined);
|
2026-07-20 16:05:17 +00:00
|
|
|
const items = [
|
|
|
|
|
context,
|
2026-09-10 05:38:07 +00:00
|
|
|
function useContext() {
|
|
|
|
|
context = noop.useContext(context);
|
2026-07-29 08:29:29 +00:00
|
|
|
if (null == context) {
|
|
|
|
|
const _Error = Error;
|
2026-09-10 05:38:07 +00:00
|
|
|
const error = new Error("Context was used outside of defined provider.");
|
2026-07-29 08:29:29 +00:00
|
|
|
throw error;
|
|
|
|
|
} else {
|
|
|
|
|
return context;
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-07-20 16:05:17 +00:00
|
|
|
() => {
|
2026-07-29 08:29:29 +00:00
|
|
|
context = context.useContext(context);
|
|
|
|
|
if (null == context) {
|
|
|
|
|
const _Error = Error;
|
2026-09-10 05:38:07 +00:00
|
|
|
const error = new Error("Context was used outside of defined provider.");
|
2026-07-29 08:29:29 +00:00
|
|
|
throw error;
|
|
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
return (children) => <context.Provider value={context}>{arg0.children}</context.Provider>;
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
return items;
|
|
|
|
|
};
|