@isograph/react-disposable-state 0.0.0-main-5dab6dd7 → 0.0.0-main-a3d4bd1e

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
  ../.. |  WARN  Unsupported engine: wanted: {"node":"22.9.0"} (current: {"node":"v22.21.1","pnpm":"10.15.0"})
2
2
 
3
- > @isograph/react-disposable-state@0.0.0-main-5dab6dd7 compile-libs /home/runner/work/isograph/isograph/libs/isograph-react-disposable-state
3
+ > @isograph/react-disposable-state@0.0.0-main-a3d4bd1e compile-libs /home/runner/work/isograph/isograph/libs/isograph-react-disposable-state
4
4
  > rimraf dist && tsc -p tsconfig.pkg.json
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"CacheItem.d.ts","sourceRoot":"","sources":["../src/CacheItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAIpC,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,6BAA6B,CAAC;CACrC,CAAC;AACF,MAAM,MAAM,8BAA8B,CAAC,CAAC,IAAI;IAC9C,IAAI,EAAE,gCAAgC,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IAGzB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AACF,MAAM,MAAM,2BAA2B,CAAC,CAAC,IAAI;IAC3C,IAAI,EAAE,6BAA6B,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC;IACT,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAGlC,oBAAoB,EAAE,MAAM,CAAC;IAG7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,IACxB,2BAA2B,CAAC,CAAC,CAAC,GAC9B,8BA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59
59
  }
60
- default: {
60
+ case 'NotInParentCacheAndDisposed': {
61
61
  throw new Error('Attempted to access disposed value from CacheItem. ' +
62
62
  'This indicates a bug in react-disposable-state.');
63
63
  }
@@ -88,7 +88,7 @@ class CacheItem {
88
88
  this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
89
89
  return;
90
90
  }
91
- default: {
91
+ case 'NotInParentCacheAndDisposed': {
92
92
  throw new Error('CacheItem was in a disposed state, but there existed a permanent retain. ' +
93
93
  'This indicates a bug in react-disposable-state.');
94
94
  }
@@ -114,7 +114,8 @@ class CacheItem {
114
114
  this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
115
115
  return;
116
116
  }
117
- default: {
117
+ case 'InParentCacheAndNotDisposed':
118
+ case 'NotInParentCacheAndDisposed': {
118
119
  throw new Error('CacheItem was in an unexpected state. ' +
119
120
  'This indicates a bug in react-disposable-state.');
120
121
  }
@@ -122,7 +123,7 @@ class CacheItem {
122
123
  },
123
124
  ];
124
125
  }
125
- default: {
126
+ case 'NotInParentCacheAndDisposed': {
126
127
  // The CacheItem is disposed, so disposeOfTemporaryRetain is a no-op
127
128
  return null;
128
129
  }
@@ -147,7 +148,8 @@ class CacheItem {
147
148
  clearTimeout(timeoutId);
148
149
  return;
149
150
  }
150
- default: {
151
+ case 'NotInParentCacheAndDisposed':
152
+ case 'NotInParentCacheAndNotDisposed': {
151
153
  throw new Error('A temporary retain was cleared, for which the CacheItem is in an invalid state. ' +
152
154
  'This indicates a bug in react-disposable-state.');
153
155
  }
@@ -162,7 +164,8 @@ class CacheItem {
162
164
  this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
163
165
  return;
164
166
  }
165
- default: {
167
+ case 'NotInParentCacheAndDisposed':
168
+ case 'NotInParentCacheAndNotDisposed': {
166
169
  throw new Error('A temporary retain was cleared, for which the CacheItem is in an invalid state. ' +
167
170
  'This indicates a bug in react-disposable-state.');
168
171
  }
@@ -171,7 +174,8 @@ class CacheItem {
171
174
  const timeoutId = setTimeout(clearTemporaryRetainByTimeout, (_b = (_a = this.__options) === null || _a === void 0 ? void 0 : _a.temporaryRetainTime) !== null && _b !== void 0 ? _b : DEFAULT_TEMPORARY_RETAIN_TIME);
172
175
  return clearTemporaryRetainByCallack;
173
176
  }
174
- default: {
177
+ case 'NotInParentCacheAndDisposed':
178
+ case 'NotInParentCacheAndNotDisposed': {
175
179
  throw new Error('temporaryRetain was called, for which the CacheItem is in an invalid state. ' +
176
180
  'This indicates a bug in react-disposable-state.');
177
181
  }
@@ -199,7 +203,7 @@ class CacheItem {
199
203
  this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
200
204
  return;
201
205
  }
202
- default: {
206
+ case 'NotInParentCacheAndDisposed': {
203
207
  throw new Error('CacheItem was in a disposed state, but there existed a permanent retain. ' +
204
208
  'This indicates a bug in react-disposable-state.');
205
209
  }
@@ -221,14 +225,15 @@ class CacheItem {
221
225
  this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
222
226
  return;
223
227
  }
224
- default: {
228
+ case 'InParentCacheAndNotDisposed':
229
+ case 'NotInParentCacheAndDisposed': {
225
230
  throw new Error('CacheItem was in an unexpected state. ' +
226
231
  'This indicates a bug in react-disposable-state.');
227
232
  }
228
233
  }
229
234
  };
230
235
  }
231
- default: {
236
+ case 'NotInParentCacheAndDisposed': {
232
237
  throw new Error('permanentRetain was called, but the CacheItem is in an invalid state. ' +
233
238
  'This indicates a bug in react-disposable-state.');
234
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isograph/react-disposable-state",
3
- "version": "0.0.0-main-5dab6dd7",
3
+ "version": "0.0.0-main-a3d4bd1e",
4
4
  "description": "Primitives for managing disposable state in React",
5
5
  "homepage": "https://isograph.dev",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,7 @@
8
8
  "author": "Isograph Labs",
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
- "@isograph/disposable-types": "0.0.0-main-5dab6dd7"
11
+ "@isograph/disposable-types": "0.0.0-main-a3d4bd1e"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "react": "^18.0.0 || ^19.0.0"
package/src/CacheItem.ts CHANGED
@@ -102,7 +102,7 @@ export class CacheItem<T> {
102
102
  case 'NotInParentCacheAndNotDisposed': {
103
103
  return this.__state.value;
104
104
  }
105
- default: {
105
+ case 'NotInParentCacheAndDisposed': {
106
106
  throw new Error(
107
107
  'Attempted to access disposed value from CacheItem. ' +
108
108
  'This indicates a bug in react-disposable-state.',
@@ -142,7 +142,7 @@ export class CacheItem<T> {
142
142
  );
143
143
  return;
144
144
  }
145
- default: {
145
+ case 'NotInParentCacheAndDisposed': {
146
146
  throw new Error(
147
147
  'CacheItem was in a disposed state, but there existed a permanent retain. ' +
148
148
  'This indicates a bug in react-disposable-state.',
@@ -174,7 +174,8 @@ export class CacheItem<T> {
174
174
  );
175
175
  return;
176
176
  }
177
- default: {
177
+ case 'InParentCacheAndNotDisposed':
178
+ case 'NotInParentCacheAndDisposed': {
178
179
  throw new Error(
179
180
  'CacheItem was in an unexpected state. ' +
180
181
  'This indicates a bug in react-disposable-state.',
@@ -184,7 +185,7 @@ export class CacheItem<T> {
184
185
  },
185
186
  ];
186
187
  }
187
- default: {
188
+ case 'NotInParentCacheAndDisposed': {
188
189
  // The CacheItem is disposed, so disposeOfTemporaryRetain is a no-op
189
190
  return null;
190
191
  }
@@ -215,7 +216,8 @@ export class CacheItem<T> {
215
216
  clearTimeout(timeoutId);
216
217
  return;
217
218
  }
218
- default: {
219
+ case 'NotInParentCacheAndDisposed':
220
+ case 'NotInParentCacheAndNotDisposed': {
219
221
  throw new Error(
220
222
  'A temporary retain was cleared, for which the CacheItem is in an invalid state. ' +
221
223
  'This indicates a bug in react-disposable-state.',
@@ -233,7 +235,8 @@ export class CacheItem<T> {
233
235
  this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
234
236
  return;
235
237
  }
236
- default: {
238
+ case 'NotInParentCacheAndDisposed':
239
+ case 'NotInParentCacheAndNotDisposed': {
237
240
  throw new Error(
238
241
  'A temporary retain was cleared, for which the CacheItem is in an invalid state. ' +
239
242
  'This indicates a bug in react-disposable-state.',
@@ -248,7 +251,8 @@ export class CacheItem<T> {
248
251
  );
249
252
  return clearTemporaryRetainByCallack;
250
253
  }
251
- default: {
254
+ case 'NotInParentCacheAndDisposed':
255
+ case 'NotInParentCacheAndNotDisposed': {
252
256
  throw new Error(
253
257
  'temporaryRetain was called, for which the CacheItem is in an invalid state. ' +
254
258
  'This indicates a bug in react-disposable-state.',
@@ -281,7 +285,7 @@ export class CacheItem<T> {
281
285
  this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
282
286
  return;
283
287
  }
284
- default: {
288
+ case 'NotInParentCacheAndDisposed': {
285
289
  throw new Error(
286
290
  'CacheItem was in a disposed state, but there existed a permanent retain. ' +
287
291
  'This indicates a bug in react-disposable-state.',
@@ -307,7 +311,8 @@ export class CacheItem<T> {
307
311
  this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
308
312
  return;
309
313
  }
310
- default: {
314
+ case 'InParentCacheAndNotDisposed':
315
+ case 'NotInParentCacheAndDisposed': {
311
316
  throw new Error(
312
317
  'CacheItem was in an unexpected state. ' +
313
318
  'This indicates a bug in react-disposable-state.',
@@ -316,7 +321,7 @@ export class CacheItem<T> {
316
321
  }
317
322
  };
318
323
  }
319
- default: {
324
+ case 'NotInParentCacheAndDisposed': {
320
325
  throw new Error(
321
326
  'permanentRetain was called, but the CacheItem is in an invalid state. ' +
322
327
  'This indicates a bug in react-disposable-state.',