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