@isograph/react 0.0.0-main-bee27aa9 → 0.0.0-main-0a7c1aef

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.
@@ -9,6 +9,9 @@ function useRerenderWhenEncounteredRecordChanges(environment, encounteredRecords
9
9
  return (0, cache_1.subscribe)(environment, encounteredRecords, () => {
10
10
  return setState({});
11
11
  });
12
+ // TODO this is probably buggy — we should re-evaluate the effect when
13
+ // encounteredRecords changes. However, it is not a stable object, so...
14
+ // how?
12
15
  }, []);
13
16
  }
14
17
  exports.useRerenderWhenEncounteredRecordChanges = useRerenderWhenEncounteredRecordChanges;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isograph/react",
3
- "version": "0.0.0-main-bee27aa9",
3
+ "version": "0.0.0-main-0a7c1aef",
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-bee27aa9",
20
- "@isograph/react-disposable-state": "0.0.0-main-bee27aa9",
19
+ "@isograph/disposable-types": "0.0.0-main-0a7c1aef",
20
+ "@isograph/react-disposable-state": "0.0.0-main-0a7c1aef",
21
21
  "react": "^18.2.0"
22
22
  },
23
23
  "devDependencies": {
@@ -6,12 +6,24 @@ import entrypoint_Query__meNameSuccessor from '../__isograph/Query/meNameSuccess
6
6
  import entrypoint_Query__meName from '../__isograph/Query/meName/entrypoint';
7
7
  import entrypoint_Query__nodeField from '../__isograph/Query/nodeField/entrypoint';
8
8
 
9
+ // This is the type given to regular client fields.
10
+ // This means that the type of the exported iso literal is exactly
11
+ // the type of the passed-in function, which takes one parameter
12
+ // of type TParam.
9
13
  type IdentityWithParam<TParam> = <TClientFieldReturn>(
10
14
  x: (param: TParam) => TClientFieldReturn
11
15
  ) => (param: TParam) => TClientFieldReturn;
12
- type IdentityWithParamComponent<TParam> = <TClientFieldReturn, TSecondParam = Record<string, never>>(
13
- x: (data: TParam, secondParam: TSecondParam) => TClientFieldReturn
14
- ) => (data: TParam, secondParam: TSecondParam) => TClientFieldReturn;
16
+
17
+ // This is the type given it to client fields with @component.
18
+ // This means that the type of the exported iso literal is exactly
19
+ // the type of the passed-in function, which takes two parameters.
20
+ // The first has type TParam, and the second has type TAdditionalProps.
21
+ //
22
+ // TAdditionalProps becomes the types of the props you must pass
23
+ // whenever the @component field is rendered.
24
+ type IdentityWithParamComponent<TParam> = <TClientFieldReturn, TAdditionalProps = Record<string, never>>(
25
+ x: (data: TParam, secondParam: TAdditionalProps) => TClientFieldReturn
26
+ ) => (data: TParam, secondParam: TAdditionalProps) => TClientFieldReturn;
15
27
 
16
28
  type WhitespaceCharacter = ' ' | '\t' | '\n';
17
29
  type Whitespace<In> = In extends `${WhitespaceCharacter}${infer In}`
@@ -11,5 +11,8 @@ export function useRerenderWhenEncounteredRecordChanges(
11
11
  return subscribe(environment, encounteredRecords, () => {
12
12
  return setState({});
13
13
  });
14
+ // TODO this is probably buggy — we should re-evaluate the effect when
15
+ // encounteredRecords changes. However, it is not a stable object, so...
16
+ // how?
14
17
  }, []);
15
18
  }