Initial Sample.
This commit is contained in:
4
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/__use.d.ts
generated
vendored
Normal file
4
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/__use.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
type Use = <T>(promise: Promise<T>) => T;
|
||||
export declare const __use: Use;
|
||||
export {};
|
||||
//# sourceMappingURL=__use.d.ts.map
|
||||
22
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/__use.js
generated
vendored
Normal file
22
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/__use.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { wrapPromiseWithState } from "../../../utilities/index.js";
|
||||
import * as React from "rehackt";
|
||||
// Prevent webpack from complaining about our feature detection of the
|
||||
// use property of the React namespace, which is expected not
|
||||
// to exist when using current stable versions, and that's fine.
|
||||
var useKey = "use";
|
||||
var realHook = React[useKey];
|
||||
// This is named with two underscores to allow this hook to evade typical rules of
|
||||
// hooks (i.e. it can be used conditionally)
|
||||
export var __use = realHook ||
|
||||
function __use(promise) {
|
||||
var statefulPromise = wrapPromiseWithState(promise);
|
||||
switch (statefulPromise.status) {
|
||||
case "pending":
|
||||
throw statefulPromise;
|
||||
case "rejected":
|
||||
throw statefulPromise.reason;
|
||||
case "fulfilled":
|
||||
return statefulPromise.value;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=__use.js.map
|
||||
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/__use.js.map
generated
vendored
Normal file
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/__use.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"__use.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/__use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAGjC,sEAAsE;AACtE,6DAA6D;AAC7D,gEAAgE;AAChE,IAAM,MAAM,GAAG,KAA2B,CAAC;AAC3C,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAoB,CAAC;AAElD,kFAAkF;AAClF,4CAA4C;AAC5C,MAAM,CAAC,IAAM,KAAK,GAChB,QAAQ;IACR,SAAS,KAAK,CAAS,OAAwB;QAC7C,IAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEtD,QAAQ,eAAe,CAAC,MAAM,EAAE,CAAC;YAC/B,KAAK,SAAS;gBACZ,MAAM,eAAe,CAAC;YACxB,KAAK,UAAU;gBACb,MAAM,eAAe,CAAC,MAAM,CAAC;YAC/B,KAAK,WAAW;gBACd,OAAO,eAAe,CAAC,KAAK,CAAC;QACjC,CAAC;IACH,CAAC,CAAC","sourcesContent":["import { wrapPromiseWithState } from \"../../../utilities/index.js\";\nimport * as React from \"rehackt\";\n\ntype Use = <T>(promise: Promise<T>) => T;\n// Prevent webpack from complaining about our feature detection of the\n// use property of the React namespace, which is expected not\n// to exist when using current stable versions, and that's fine.\nconst useKey = \"use\" as keyof typeof React;\nconst realHook = React[useKey] as Use | undefined;\n\n// This is named with two underscores to allow this hook to evade typical rules of\n// hooks (i.e. it can be used conditionally)\nexport const __use =\n realHook ||\n function __use<TValue>(promise: Promise<TValue>) {\n const statefulPromise = wrapPromiseWithState(promise);\n\n switch (statefulPromise.status) {\n case \"pending\":\n throw statefulPromise;\n case \"rejected\":\n throw statefulPromise.reason;\n case \"fulfilled\":\n return statefulPromise.value;\n }\n };\n"]}
|
||||
6
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/index.d.ts
generated
vendored
Normal file
6
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export { useDeepMemo } from "./useDeepMemo.js";
|
||||
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
|
||||
export { useRenderGuard } from "./useRenderGuard.js";
|
||||
export { useLazyRef } from "./useLazyRef.js";
|
||||
export { __use } from "./__use.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
7
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/index.js
generated
vendored
Normal file
7
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// These hooks are used internally and are not exported publicly by the library
|
||||
export { useDeepMemo } from "./useDeepMemo.js";
|
||||
export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
|
||||
export { useRenderGuard } from "./useRenderGuard.js";
|
||||
export { useLazyRef } from "./useLazyRef.js";
|
||||
export { __use } from "./__use.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/index.js.map
generated
vendored
Normal file
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// These hooks are used internally and are not exported publicly by the library\nexport { useDeepMemo } from \"./useDeepMemo.js\";\nexport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\nexport { useRenderGuard } from \"./useRenderGuard.js\";\nexport { useLazyRef } from \"./useLazyRef.js\";\nexport { __use } from \"./__use.js\";\n"]}
|
||||
3
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.d.ts
generated
vendored
Normal file
3
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { DependencyList } from "react";
|
||||
export declare function useDeepMemo<TValue>(memoFn: () => TValue, deps: DependencyList): TValue;
|
||||
//# sourceMappingURL=useDeepMemo.d.ts.map
|
||||
10
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js
generated
vendored
Normal file
10
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from "rehackt";
|
||||
import { equal } from "@wry/equality";
|
||||
export function useDeepMemo(memoFn, deps) {
|
||||
var ref = React.useRef();
|
||||
if (!ref.current || !equal(ref.current.deps, deps)) {
|
||||
ref.current = { value: memoFn(), deps: deps };
|
||||
}
|
||||
return ref.current.value;
|
||||
}
|
||||
//# sourceMappingURL=useDeepMemo.js.map
|
||||
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js.map
generated
vendored
Normal file
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useDeepMemo.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useDeepMemo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,UAAU,WAAW,CACzB,MAAoB,EACpB,IAAoB;IAEpB,IAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAA2C,CAAC;IAEpE,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;AAC3B,CAAC","sourcesContent":["import type { DependencyList } from \"react\";\nimport * as React from \"rehackt\";\nimport { equal } from \"@wry/equality\";\n\nexport function useDeepMemo<TValue>(\n memoFn: () => TValue,\n deps: DependencyList\n) {\n const ref = React.useRef<{ deps: DependencyList; value: TValue }>();\n\n if (!ref.current || !equal(ref.current.deps, deps)) {\n ref.current = { value: memoFn(), deps };\n }\n\n return ref.current.value;\n}\n"]}
|
||||
4
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.d.ts
generated
vendored
Normal file
4
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference types="react" />
|
||||
import * as React from "rehackt";
|
||||
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
|
||||
//# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map
|
||||
9
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js
generated
vendored
Normal file
9
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as React from "rehackt";
|
||||
import { canUseDOM } from "../../../utilities/index.js";
|
||||
// use canUseDOM here instead of canUseLayoutEffect because we want to be able
|
||||
// to use useLayoutEffect in our jest tests. useLayoutEffect seems to work fine
|
||||
// in useSuspenseQuery tests, but to honor the original comment about the
|
||||
// warnings for useSyncExternalStore implementation, canUseLayoutEffect is left
|
||||
// alone.
|
||||
export var useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect;
|
||||
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
||||
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js.map
generated
vendored
Normal file
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useIsomorphicLayoutEffect.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,8EAA8E;AAC9E,+EAA+E;AAC/E,yEAAyE;AACzE,+EAA+E;AAC/E,SAAS;AACT,MAAM,CAAC,IAAM,yBAAyB,GACpC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC","sourcesContent":["import * as React from \"rehackt\";\nimport { canUseDOM } from \"../../../utilities/index.js\";\n\n// use canUseDOM here instead of canUseLayoutEffect because we want to be able\n// to use useLayoutEffect in our jest tests. useLayoutEffect seems to work fine\n// in useSuspenseQuery tests, but to honor the original comment about the\n// warnings for useSyncExternalStore implementation, canUseLayoutEffect is left\n// alone.\nexport const useIsomorphicLayoutEffect =\n canUseDOM ? React.useLayoutEffect : React.useEffect;\n"]}
|
||||
4
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useLazyRef.d.ts
generated
vendored
Normal file
4
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useLazyRef.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference types="react" />
|
||||
import * as React from "rehackt";
|
||||
export declare function useLazyRef<T>(getInitialValue: () => T): React.MutableRefObject<T>;
|
||||
//# sourceMappingURL=useLazyRef.d.ts.map
|
||||
10
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useLazyRef.js
generated
vendored
Normal file
10
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useLazyRef.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from "rehackt";
|
||||
var INIT = {};
|
||||
export function useLazyRef(getInitialValue) {
|
||||
var ref = React.useRef(INIT);
|
||||
if (ref.current === INIT) {
|
||||
ref.current = getInitialValue();
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
//# sourceMappingURL=useLazyRef.js.map
|
||||
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useLazyRef.js.map
generated
vendored
Normal file
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useLazyRef.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useLazyRef.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useLazyRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,IAAM,IAAI,GAAG,EAAE,CAAC;AAEhB,MAAM,UAAU,UAAU,CAAI,eAAwB;IACpD,IAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAI,IAAoB,CAAC,CAAC;IAElD,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACzB,GAAG,CAAC,OAAO,GAAG,eAAe,EAAE,CAAC;IAClC,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as React from \"rehackt\";\n\nconst INIT = {};\n\nexport function useLazyRef<T>(getInitialValue: () => T) {\n const ref = React.useRef<T>(INIT as unknown as T);\n\n if (ref.current === INIT) {\n ref.current = getInitialValue();\n }\n\n return ref;\n}\n"]}
|
||||
2
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.d.ts
generated
vendored
Normal file
2
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function useRenderGuard(): () => boolean;
|
||||
//# sourceMappingURL=useRenderGuard.d.ts.map
|
||||
17
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js
generated
vendored
Normal file
17
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as React from "rehackt";
|
||||
function getRenderDispatcher() {
|
||||
var _a, _b;
|
||||
return (_b = (_a = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
|
||||
}
|
||||
var RenderDispatcher = null;
|
||||
/*
|
||||
Relay does this too, so we hope this is safe.
|
||||
https://github.com/facebook/relay/blob/8651fbca19adbfbb79af7a3bc40834d105fd7747/packages/react-relay/relay-hooks/loadQuery.js#L90-L98
|
||||
*/
|
||||
export function useRenderGuard() {
|
||||
RenderDispatcher = getRenderDispatcher();
|
||||
return React.useCallback(function () {
|
||||
return (RenderDispatcher !== null && RenderDispatcher === getRenderDispatcher());
|
||||
}, []);
|
||||
}
|
||||
//# sourceMappingURL=useRenderGuard.js.map
|
||||
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js.map
generated
vendored
Normal file
1
graphql-subscription/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"useRenderGuard.js","sourceRoot":"","sources":["../../../../src/react/hooks/internal/useRenderGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,SAAS,mBAAmB;;IAC1B,OAAO,MAAA,MAAC,KAAa,CAAC,kDAAkD,0CACpE,sBAAsB,0CAAE,OAAO,CAAC;AACtC,CAAC;AAED,IAAI,gBAAgB,GAAY,IAAI,CAAC;AAErC;;;EAGE;AACF,MAAM,UAAU,cAAc;IAC5B,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAEzC,OAAO,KAAK,CAAC,WAAW,CAAC;QACvB,OAAO,CACL,gBAAgB,KAAK,IAAI,IAAI,gBAAgB,KAAK,mBAAmB,EAAE,CACxE,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["import * as React from \"rehackt\";\n\nfunction getRenderDispatcher() {\n return (React as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n ?.ReactCurrentDispatcher?.current;\n}\n\nlet RenderDispatcher: unknown = null;\n\n/*\nRelay does this too, so we hope this is safe.\nhttps://github.com/facebook/relay/blob/8651fbca19adbfbb79af7a3bc40834d105fd7747/packages/react-relay/relay-hooks/loadQuery.js#L90-L98\n*/\nexport function useRenderGuard() {\n RenderDispatcher = getRenderDispatcher();\n\n return React.useCallback(() => {\n return (\n RenderDispatcher !== null && RenderDispatcher === getRenderDispatcher()\n );\n }, []);\n}\n"]}
|
||||
Reference in New Issue
Block a user