@isograph/react 0.0.0-main-0b32e705 → 0.0.0-main-2ec2b35d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ParentCache } from '@isograph/isograph-react-disposable-state';
2
+ import { ParentCache } from '@isograph/react-disposable-state';
3
3
  import { RetainedQuery } from './garbageCollection';
4
4
  type ComponentName = string;
5
5
  type StringifiedArgs = string;
@@ -54,5 +54,5 @@ export declare function defaultMissingFieldHandler(_storeRecord: StoreRecord, _r
54
54
  } | null, variables: {
55
55
  [index: string]: any;
56
56
  } | null): Link | undefined;
57
- export declare function assertLink(link: DataTypeValue): Link | null;
57
+ export declare function assertLink(link: DataTypeValue): Link | null | undefined;
58
58
  export {};
@@ -39,7 +39,7 @@ function assertLink(link) {
39
39
  throw new Error('Unexpected array');
40
40
  }
41
41
  if (link == null) {
42
- return null;
42
+ return link;
43
43
  }
44
44
  if (typeof link === 'object') {
45
45
  return link;
@@ -5,7 +5,7 @@ const IsographEnvironmentProvider_1 = require("./IsographEnvironmentProvider");
5
5
  const IsographEnvironment_1 = require("./IsographEnvironment");
6
6
  const entrypoint_1 = require("./entrypoint");
7
7
  const cache_1 = require("./cache");
8
- const isograph_react_disposable_state_1 = require("@isograph/isograph-react-disposable-state");
8
+ const react_disposable_state_1 = require("@isograph/react-disposable-state");
9
9
  // Note: we cannot write TEntrypoint extends IsographEntrypoint<any, any, any>, or else
10
10
  // if we do not explicitly pass a type, the read out type will be any.
11
11
  // We cannot write TEntrypoint extends IsographEntrypoint<never, never, never>, or else
@@ -16,7 +16,7 @@ function useLazyReference(entrypoint, variables) {
16
16
  const cache = (0, cache_1.getOrCreateCacheForArtifact)(environment, entrypoint, variables);
17
17
  // TODO add comment explaining why we never use this value
18
18
  // @ts-ignore
19
- const data = (0, isograph_react_disposable_state_1.useLazyDisposableState)(cache).state;
19
+ const data = (0, react_disposable_state_1.useLazyDisposableState)(cache).state;
20
20
  return {
21
21
  queryReference: {
22
22
  kind: 'FragmentReference',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isograph/react",
3
- "version": "0.0.0-main-0b32e705",
3
+ "version": "0.0.0-main-2ec2b35d",
4
4
  "description": "Use Isograph with React",
5
5
  "homepage": "https://isograph.dev",
6
6
  "main": "dist/index.js",
@@ -16,8 +16,8 @@
16
16
  "prepack": "yarn run test && yarn run compile"
17
17
  },
18
18
  "dependencies": {
19
- "@isograph/disposable-types": "0.0.0-main-0b32e705",
20
- "@isograph/react-disposable-state": "0.0.0-main-0b32e705",
19
+ "@isograph/disposable-types": "0.0.0-main-2ec2b35d",
20
+ "@isograph/react-disposable-state": "0.0.0-main-2ec2b35d",
21
21
  "react": "^18.2.0"
22
22
  },
23
23
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- import { ParentCache } from '@isograph/isograph-react-disposable-state';
1
+ import { ParentCache } from '@isograph/react-disposable-state';
2
2
  import { RetainedQuery } from './garbageCollection';
3
3
 
4
4
  type ComponentName = string;
@@ -114,12 +114,12 @@ export function defaultMissingFieldHandler(
114
114
  }
115
115
  }
116
116
 
117
- export function assertLink(link: DataTypeValue): Link | null {
117
+ export function assertLink(link: DataTypeValue): Link | null | undefined {
118
118
  if (Array.isArray(link)) {
119
119
  throw new Error('Unexpected array');
120
120
  }
121
121
  if (link == null) {
122
- return null;
122
+ return link;
123
123
  }
124
124
  if (typeof link === 'object') {
125
125
  return link;
@@ -7,7 +7,7 @@ import {
7
7
  assertIsEntrypoint,
8
8
  } from './entrypoint';
9
9
  import { getOrCreateCacheForArtifact } from './cache';
10
- import { useLazyDisposableState } from '@isograph/isograph-react-disposable-state';
10
+ import { useLazyDisposableState } from '@isograph/react-disposable-state';
11
11
  import { type PromiseWrapper } from './PromiseWrapper';
12
12
 
13
13
  // Note: we cannot write TEntrypoint extends IsographEntrypoint<any, any, any>, or else