UNPKG

4.13 kBSource Map (JSON)View Raw
1{"version":3,"file":"context.cjs","sources":["ApolloContext.js","ApolloConsumer.js","ApolloProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseSymbol } from '../../utilities';\nvar contextKey = canUseSymbol\n ? Symbol.for('__APOLLO_CONTEXT__')\n : '__APOLLO_CONTEXT__';\nexport function getApolloContext() {\n var context = React.createContext[contextKey];\n if (!context) {\n Object.defineProperty(React.createContext, contextKey, {\n value: context = React.createContext({}),\n enumerable: false,\n writable: false,\n configurable: true,\n });\n context.displayName = 'ApolloContext';\n }\n return context;\n}\nexport { getApolloContext as resetApolloContext };\n//# sourceMappingURL=ApolloContext.js.map","import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n __DEV__ ? invariant(context && context.client, 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 28);\n return props.children(context.client);\n }));\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client: client });\n }\n __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.') : invariant(context.client, 29);\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n }));\n};\n//# sourceMappingURL=ApolloProvider.js.map"],"names":["canUseSymbol","React","invariant"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAI,UAAU,GAAGA,sBAAY;AAC7B,MAAM,MAAM,CAAC,GAAG,CAAC,oB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