decord/source/modules/window/native/AppEntryKeyContext.tsx

35 lines
1 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1497
// Function ID: 1498
2026-07-20 16:05:17 +00:00
// Name: context
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 3, 2]
2026-07-20 16:05:17 +00:00
// Exports: useAppEntryKey
2026-08-15 05:55:55 +00:00
// Module 1497 (context)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */;
import importAllResult from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c0 = importAllResult;
2026-08-24 06:08:38 +00:00
let closure_1 = new timestampDefault("AppEntryKeyContext");
2026-07-29 08:29:29 +00:00
const main = "main";
2026-07-23 10:11:24 +00:00
let context = importAllResult.createContext(undefined);
2026-07-29 08:29:29 +00:00
let c4 = false;
2026-08-24 06:08:38 +00:00
const tmp2 = new timestampDefault("AppEntryKeyContext");
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/window/native/AppEntryKeyContext.tsx");
2026-07-20 16:05:17 +00:00
export const DEFAULT_APP_ENTRY_KEY = "main";
export const AppEntryKeyContext = context;
export const useAppEntryKey = function useAppEntryKey() {
2026-07-23 10:11:24 +00:00
context = context.useContext(context);
2026-07-20 16:05:17 +00:00
const items = [context];
2026-07-23 10:11:24 +00:00
const effect = context.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-08-24 06:08:38 +00:00
c4 = true;
closure_1_1.warn("AppEntryKey context was not provided; falling back to default entry key \"main\".");
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-29 08:29:29 +00:00
if (context == null) {
context = main;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return context;
2026-07-20 16:05:17 +00:00
};