@isograph/react-disposable-state 0.0.0-main-03306d26 → 0.0.0-main-e7d6b095

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/dist/CacheItem.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTemporarilyRetainedCacheItem = exports.CacheItem = void 0;
3
+ exports.CacheItem = void 0;
4
+ exports.createTemporarilyRetainedCacheItem = createTemporarilyRetainedCacheItem;
4
5
  const DEFAULT_TEMPORARY_RETAIN_TIME = 5000;
5
6
  // TODO don't export this class, only export type (interface) instead
6
7
  // TODO convert cacheitem impl to a getter and setter and free functions
@@ -266,4 +267,3 @@ function createTemporarilyRetainedCacheItem(factory, removeFromParentCache, opti
266
267
  const disposeTemporaryRetain = cacheItem.temporaryRetain();
267
268
  return [cacheItem, disposeTemporaryRetain];
268
269
  }
269
- exports.createTemporarilyRetainedCacheItem = createTemporarilyRetainedCacheItem;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCachedResponsivePrecommitValue = void 0;
3
+ exports.useCachedResponsivePrecommitValue = useCachedResponsivePrecommitValue;
4
4
  const react_1 = require("react");
5
5
  /**
6
6
  * useCachedResponsivePrecommitValue<T>
@@ -92,4 +92,3 @@ function useCachedResponsivePrecommitValue(parentCache, onCommit) {
92
92
  const [cacheItem, item, disposeOfTemporaryRetain] = parentCache.getOrPopulateAndTemporaryRetain();
93
93
  return { state: item };
94
94
  }
95
- exports.useCachedResponsivePrecommitValue = useCachedResponsivePrecommitValue;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDisposableState = void 0;
3
+ exports.useDisposableState = useDisposableState;
4
4
  const react_1 = require("react");
5
5
  const useCachedResponsivePrecommitValue_1 = require("./useCachedResponsivePrecommitValue");
6
6
  const useUpdatableDisposableState_1 = require("./useUpdatableDisposableState");
@@ -54,7 +54,6 @@ function useDisposableState(parentCache) {
54
54
  setState,
55
55
  };
56
56
  }
57
- exports.useDisposableState = useDisposableState;
58
57
  // @ts-ignore
59
58
  function tsTests() {
60
59
  let x;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useHasCommittedRef = void 0;
3
+ exports.useHasCommittedRef = useHasCommittedRef;
4
4
  const react_1 = require("react");
5
5
  /**
6
6
  * Returns true if the component has committed, false otherwise.
@@ -12,4 +12,3 @@ function useHasCommittedRef() {
12
12
  }, []);
13
13
  return hasCommittedRef;
14
14
  }
15
- exports.useHasCommittedRef = useHasCommittedRef;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLazyDisposableState = void 0;
3
+ exports.useLazyDisposableState = useLazyDisposableState;
4
4
  const react_1 = require("react");
5
5
  const useCachedResponsivePrecommitValue_1 = require("./useCachedResponsivePrecommitValue");
6
6
  /**
@@ -40,4 +40,3 @@ function useLazyDisposableState(parentCache) {
40
40
  // so during subsequent renders, itemCleanupPairRef.current is non-null.
41
41
  throw new Error('returnedItem was unexpectedly null. This indicates a bug in react-disposable-state.');
42
42
  }
43
- exports.useLazyDisposableState = useLazyDisposableState;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useUpdatableDisposableState = exports.UNASSIGNED_STATE = void 0;
3
+ exports.UNASSIGNED_STATE = void 0;
4
+ exports.useUpdatableDisposableState = useUpdatableDisposableState;
4
5
  const react_1 = require("react");
5
6
  const useHasCommittedRef_1 = require("./useHasCommittedRef");
6
7
  exports.UNASSIGNED_STATE = Symbol();
@@ -77,7 +78,6 @@ function useUpdatableDisposableState() {
77
78
  state: stateICI !== exports.UNASSIGNED_STATE ? stateICI.item : exports.UNASSIGNED_STATE,
78
79
  };
79
80
  }
80
- exports.useUpdatableDisposableState = useUpdatableDisposableState;
81
81
  // @ts-ignore
82
82
  function tsTests() {
83
83
  const a = useUpdatableDisposableState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isograph/react-disposable-state",
3
- "version": "0.0.0-main-03306d26",
3
+ "version": "0.0.0-main-e7d6b095",
4
4
  "description": "Primitives for managing disposable state in React",
5
5
  "homepage": "https://isograph.dev",
6
6
  "main": "dist/index.js",
@@ -18,15 +18,15 @@
18
18
  "tsc": "tsc"
19
19
  },
20
20
  "dependencies": {
21
- "@isograph/disposable-types": "0.0.0-main-03306d26"
21
+ "@isograph/disposable-types": "0.0.0-main-e7d6b095"
22
22
  },
23
23
  "peerDependencies": {
24
- "react": "18.2.0"
24
+ "react": "18.3.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/react": "^18.0.31",
27
+ "@types/react": "18.3.1",
28
28
  "react-test-renderer": "^18.2.0",
29
- "typescript": "^5.0.3"
29
+ "typescript": "5.6.3"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",