1 | import * as React from "rehackt";
|
2 | import { canUseSymbol } from "../../utilities/index.js";
|
3 | import { invariant } from "../../utilities/globals/index.js";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | var contextKey = canUseSymbol ? Symbol.for("__APOLLO_CONTEXT__") : "__APOLLO_CONTEXT__";
|
9 | export function getApolloContext() {
|
10 | invariant("createContext" in React, 46);
|
11 | var context = React.createContext[contextKey];
|
12 | if (!context) {
|
13 | Object.defineProperty(React.createContext, contextKey, {
|
14 | value: (context = React.createContext({})),
|
15 | enumerable: false,
|
16 | writable: false,
|
17 | configurable: true,
|
18 | });
|
19 | context.displayName = "ApolloContext";
|
20 | }
|
21 | return context;
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export var resetApolloContext = getApolloContext;
|
29 |
|
\ | No newline at end of file |