decord/alpha/source/utils/ContextUtils.tsx
github-actions 72019a2d0c chore: update source for alpha 348.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-25 08:38:05 +00:00

40 lines
1.1 KiB
TypeScript

// Module ID: 6843
// Function ID: 6844
// Name: ContextUtils
// Dependencies: [19, 21, 2]
// Exports: default
// Module 6843 (ContextUtils)
import noop from "module_19" /* 19 */;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("utils/ContextUtils.tsx");
export default function createDefinedContext() {
context = context.createContext(undefined);
const items = [
context,
function useContext() {
context = noop.useContext(context);
if (null == context) {
const _Error = Error;
const error = new Error("Context was used outside of defined provider.");
throw error;
} else {
return context;
}
},
() => {
context = context.useContext(context);
if (null == context) {
const _Error = Error;
const error = new Error("Context was used outside of defined provider.");
throw error;
} else {
return (children) => <context.Provider value={context}>{arg0.children}</context.Provider>;
}
}
];
return items;
};