Odoo GraphQL Subscription using Node, Express JS for Sample
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
120 KiB

4 months ago
{"version":3,"file":"hooks.cjs","sources":["useApolloClient.js","useSyncExternalStore.js","useQuery.js","useLazyQuery.js","useMutation.js","useSubscription.js","useReactiveVar.js","internal/useDeepMemo.js","internal/useRenderGuard.js","internal/useLazyRef.js","internal/__use.js","useFragment.js","constants.js","useSuspenseQuery.js","useBackgroundQuery.js","useLoadableQuery.js","useQueryRefHandlers.js","useReadQuery.js"],"sourcesContent":["import { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from \"rehackt\";\nimport { getApolloContext } from \"../context/index.js\";\n/**\n * @example\n * ```jsx\n * import { useApolloClient } from '@apollo/client';\n *\n * function SomeComponent() {\n * const client = useApolloClient();\n * // `client` is now set to the `ApolloClient` instance being used by the\n * // application (that was configured using something like `ApolloProvider`)\n * }\n * ```\n *\n * @since 3.0.0\n * @returns The `ApolloClient` instance being used by the application.\n */\nexport function useApolloClient(override) {\n var context = React.useContext(getApolloContext());\n var client = override || context.client;\n invariant(!!client, 49);\n return client;\n}\n//# sourceMappingURL=useApolloClient.js.map","import { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from \"rehackt\";\nimport { canUseLayoutEffect } from \"../../utilities/index.js\";\nvar didWarnUncachedGetSnapshot = false;\n// Prevent webpack from complaining about our feature detection of the\n// useSyncExternalStore property of the React namespace, which is expected not\n// to exist when using React 17 and earlier, and that's fine.\nvar uSESKey = \"useSyncExternalStore\";\nvar realHook = React[uSESKey];\n// Adapted from https://www.npmjs.com/package/use-sync-external-store, with\n// Apollo Client deviations called out by \"// DEVIATION ...\" comments.\n// When/if React.useSyncExternalStore is defined, delegate fully to it.\nexport var useSyncExternalStore = realHook ||\n (function (subscribe, getSnapshot, getServerSnapshot) {\n // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n var value = getSnapshot();\n if (\n // DEVIATION: Using __DEV__\n globalThis.__DEV__ !== false &&\n !didWarnUncachedGetSnapshot &&\n // DEVIATION: Not using Object.is because we know our snapshots will never\n // be exotic primitive values like NaN, which is !== itself.\n value !== getSnapshot()) {\n didWarnUncachedGetSnapshot = true;\n // DEVIATION: Using invariant.error instead of console.error directly.\n globalThis.__DEV__ !== false && invariant.error(58);\n }\n // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n var _a = React.useState({\n inst: { value: value, getSnapshot: getSnapshot },\n }), inst = _a[0].inst, forceUpdate = _a[1];\n // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing