@isograph/react-disposable-state 0.0.0-main-7986369f → 0.0.0-main-18c54425

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.
@@ -42,7 +42,7 @@ function useCachedPrecommitValue(parentCache, onCommit) {
42
42
  //
43
43
  // This hook is the former, i.e. re-renders if the committed item has changed.
44
44
  const [, rerender] = (0, react_1.useState)(null);
45
- (0, react_1.useEffect)(() => {
45
+ (0, react_1.useEffect)(function didInitiallyCommit() {
46
46
  // On first commit, cacheItem may be disposed, because during the render phase,
47
47
  // we only temporarily retained the item, and the temporary retain could have
48
48
  // expired by the time of the commit.
@@ -85,7 +85,7 @@ function useCachedPrecommitValue(parentCache, onCommit) {
85
85
  if (hasCommittedRef.current) {
86
86
  return null;
87
87
  }
88
- // Safety: item is only safe to use (i.e. guaranteed not to have disposed)
88
+ // Safety: item is only safe to use (i.e. guaranteed not to have been disposed)
89
89
  // during this tick.
90
90
  const [cacheItem, item, disposeOfTemporaryRetain] = parentCache.getOrPopulateAndTemporaryRetain();
91
91
  return { state: item };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isograph/react-disposable-state",
3
- "version": "0.0.0-main-7986369f",
3
+ "version": "0.0.0-main-18c54425",
4
4
  "description": "Primitives for managing disposable state in React",
5
5
  "homepage": "https://isograph.dev",
6
6
  "main": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "tsc": "tsc"
19
19
  },
20
20
  "dependencies": {
21
- "@isograph/disposable-types": "0.0.0-main-7986369f"
21
+ "@isograph/disposable-types": "0.0.0-main-18c54425"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": "18.2.0"
@@ -48,7 +48,7 @@ export function useCachedPrecommitValue<T>(
48
48
  // This hook is the former, i.e. re-renders if the committed item has changed.
49
49
  const [, rerender] = useState<{} | null>(null);
50
50
 
51
- useEffect(() => {
51
+ useEffect(function didInitiallyCommit() {
52
52
  // On first commit, cacheItem may be disposed, because during the render phase,
53
53
  // we only temporarily retained the item, and the temporary retain could have
54
54
  // expired by the time of the commit.
@@ -95,7 +95,7 @@ export function useCachedPrecommitValue<T>(
95
95
  return null;
96
96
  }
97
97
 
98
- // Safety: item is only safe to use (i.e. guaranteed not to have disposed)
98
+ // Safety: item is only safe to use (i.e. guaranteed not to have been disposed)
99
99
  // during this tick.
100
100
  const [cacheItem, item, disposeOfTemporaryRetain] =
101
101
  parentCache.getOrPopulateAndTemporaryRetain();