@trackunit/react-graphql-hooks 1.15.9 → 1.15.10

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.
package/index.cjs.js CHANGED
@@ -474,7 +474,8 @@ const usePaginationQuery = (document, props) => {
474
474
  react.useEffect(() => {
475
475
  isInitializedRef.current = true;
476
476
  }, []);
477
- // Fetch the initial page on mount and whenever resetTrigger changes.
477
+ // Fetch the initial page on mount, whenever resetTrigger changes, or when
478
+ // skip transitions (so an initially-skipped query fires once unskipped).
478
479
  // Variable changes flow through the reset effect above which increments
479
480
  // resetTrigger, so stableVariables is intentionally NOT a dependency here.
480
481
  react.useEffect(() => {
@@ -485,7 +486,7 @@ const usePaginationQuery = (document, props) => {
485
486
  after: latestRef.current.after ?? undefined,
486
487
  };
487
488
  latestRef.current.executeFetch(fetchVariables, undefined, "initial");
488
- }, [state.resetTrigger, pageSize]);
489
+ }, [state.resetTrigger, pageSize, props.skip]);
489
490
  // Fetch next/previous page when relay cursor changes
490
491
  react.useEffect(() => {
491
492
  if (!hasLoadedDataRef.current) {
package/index.esm.js CHANGED
@@ -472,7 +472,8 @@ const usePaginationQuery = (document, props) => {
472
472
  useEffect(() => {
473
473
  isInitializedRef.current = true;
474
474
  }, []);
475
- // Fetch the initial page on mount and whenever resetTrigger changes.
475
+ // Fetch the initial page on mount, whenever resetTrigger changes, or when
476
+ // skip transitions (so an initially-skipped query fires once unskipped).
476
477
  // Variable changes flow through the reset effect above which increments
477
478
  // resetTrigger, so stableVariables is intentionally NOT a dependency here.
478
479
  useEffect(() => {
@@ -483,7 +484,7 @@ const usePaginationQuery = (document, props) => {
483
484
  after: latestRef.current.after ?? undefined,
484
485
  };
485
486
  latestRef.current.executeFetch(fetchVariables, undefined, "initial");
486
- }, [state.resetTrigger, pageSize]);
487
+ }, [state.resetTrigger, pageSize, props.skip]);
487
488
  // Fetch next/previous page when relay cursor changes
488
489
  useEffect(() => {
489
490
  if (!hasLoadedDataRef.current) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-graphql-hooks",
3
- "version": "1.15.9",
3
+ "version": "1.15.10",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {