@isograph/react-disposable-state 0.0.0-main-b8e58245 → 0.0.0-main-709dc2bb

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.
Files changed (57) hide show
  1. package/.turbo/turbo-compile-libs.log +9 -2
  2. package/dist/CacheItem.d.mts +63 -0
  3. package/dist/CacheItem.d.mts.map +1 -0
  4. package/dist/CacheItem.d.ts +33 -29
  5. package/dist/CacheItem.d.ts.map +1 -1
  6. package/dist/CacheItem.js +191 -271
  7. package/dist/CacheItem.mjs +193 -0
  8. package/dist/CacheItem.mjs.map +1 -0
  9. package/dist/ParentCache.d.mts +45 -0
  10. package/dist/ParentCache.d.mts.map +1 -0
  11. package/dist/ParentCache.d.ts +27 -22
  12. package/dist/ParentCache.d.ts.map +1 -1
  13. package/dist/ParentCache.js +69 -85
  14. package/dist/ParentCache.mjs +73 -0
  15. package/dist/ParentCache.mjs.map +1 -0
  16. package/dist/_virtual/rolldown_runtime.js +25 -0
  17. package/dist/index.d.mts +9 -0
  18. package/dist/index.d.ts +9 -9
  19. package/dist/index.js +24 -24
  20. package/dist/index.mjs +11 -0
  21. package/dist/useCachedResponsivePrecommitValue.d.mts +43 -0
  22. package/dist/useCachedResponsivePrecommitValue.d.mts.map +1 -0
  23. package/dist/useCachedResponsivePrecommitValue.d.ts +9 -4
  24. package/dist/useCachedResponsivePrecommitValue.d.ts.map +1 -1
  25. package/dist/useCachedResponsivePrecommitValue.js +55 -90
  26. package/dist/useCachedResponsivePrecommitValue.mjs +57 -0
  27. package/dist/useCachedResponsivePrecommitValue.mjs.map +1 -0
  28. package/dist/useDisposableState.d.mts +13 -0
  29. package/dist/useDisposableState.d.mts.map +1 -0
  30. package/dist/useDisposableState.d.ts +10 -7
  31. package/dist/useDisposableState.d.ts.map +1 -1
  32. package/dist/useDisposableState.js +36 -72
  33. package/dist/useDisposableState.mjs +37 -0
  34. package/dist/useDisposableState.mjs.map +1 -0
  35. package/dist/useHasCommittedRef.d.mts +11 -0
  36. package/dist/useHasCommittedRef.d.mts.map +1 -0
  37. package/dist/useHasCommittedRef.d.ts +7 -2
  38. package/dist/useHasCommittedRef.d.ts.map +1 -1
  39. package/dist/useHasCommittedRef.js +15 -11
  40. package/dist/useHasCommittedRef.mjs +17 -0
  41. package/dist/useHasCommittedRef.mjs.map +1 -0
  42. package/dist/useLazyDisposableState.d.mts +20 -0
  43. package/dist/useLazyDisposableState.d.mts.map +1 -0
  44. package/dist/useLazyDisposableState.d.ts +9 -4
  45. package/dist/useLazyDisposableState.d.ts.map +1 -1
  46. package/dist/useLazyDisposableState.js +32 -39
  47. package/dist/useLazyDisposableState.mjs +34 -0
  48. package/dist/useLazyDisposableState.mjs.map +1 -0
  49. package/dist/useUpdatableDisposableState.d.mts +43 -0
  50. package/dist/useUpdatableDisposableState.d.mts.map +1 -0
  51. package/dist/useUpdatableDisposableState.d.ts +10 -7
  52. package/dist/useUpdatableDisposableState.d.ts.map +1 -1
  53. package/dist/useUpdatableDisposableState.js +73 -89
  54. package/dist/useUpdatableDisposableState.mjs +74 -0
  55. package/dist/useUpdatableDisposableState.mjs.map +1 -0
  56. package/package.json +14 -6
  57. package/dist/index.d.ts.map +0 -1
package/dist/CacheItem.js CHANGED
@@ -1,274 +1,194 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CacheItem = void 0;
4
- exports.createTemporarilyRetainedCacheItem = createTemporarilyRetainedCacheItem;
5
- const DEFAULT_TEMPORARY_RETAIN_TIME = 5000;
6
- // TODO don't export this class, only export type (interface) instead
7
- // TODO convert cacheitem impl to a getter and setter and free functions
1
+
2
+ //#region src/CacheItem.ts
3
+ const DEFAULT_TEMPORARY_RETAIN_TIME = 5e3;
8
4
  /**
9
- * CacheItem:
10
- *
11
- * Terminology:
12
- * - TRC = Temporary Retain Count
13
- * - PRC = Permanent Retain Count
14
- *
15
- * A CacheItem<T> can be in three states:
16
- * In parent cache? | Item disposed? | TRC | PRC | Name
17
- * -----------------+----------------+-----+-----+-------------------------------
18
- * In parent cache | Not disposed | >0 | >=0 | InParentCacheAndNotDisposed
19
- * Removed | Not disposed | 0 | >0 | NotInParentCacheAndNotDisposed
20
- * Removed | Disposed | 0 | 0 | NotInParentCacheAndNotDisposed
21
- *
22
- * A cache item can only move down rows. As in, if its in the parent cache,
23
- * it can be removed. It can never be replaced in the parent cache. (If a
24
- * parent cache becomes full again, it will contain a new CacheItem.) The
25
- * contained item can be disposed, but never un-disposed.
26
- *
27
- * So, the valid transitions are:
28
- * - InParentCacheAndNotDisposed => NotInParentCacheAndNotDisposed
29
- * - InParentCacheAndNotDisposed => NotInParentCacheAndDisposed
30
- * - NotInParentCacheAndNotDisposed => NotInParentCacheAndDisposed
31
- */
32
- class CacheItem {
33
- // Private. Do not call this constructor directly. Use
34
- // createTemporarilyRetainedCacheItem instead. This is because this
35
- // constructor creates a CacheItem in an invalid state. It must be
36
- // temporarily retained to enter a valid state, and JavaScript doesn't
37
- // let you return a tuple from a constructor.
38
- constructor(factory, removeFromParentCache, options) {
39
- this.__options = options !== null && options !== void 0 ? options : null;
40
- const [value, disposeValue] = factory();
41
- this.__state = {
42
- kind: 'InParentCacheAndNotDisposed',
43
- value,
44
- disposeValue,
45
- removeFromParentCache,
46
- // NOTE: we are creating the CacheItem in an invalid state. This is okay, because
47
- // we are immediately calling .temporaryRetain.
48
- temporaryRetainCount: 0,
49
- permanentRetainCount: 0,
50
- };
51
- }
52
- getValue() {
53
- switch (this.__state.kind) {
54
- case 'InParentCacheAndNotDisposed': {
55
- return this.__state.value;
56
- }
57
- case 'NotInParentCacheAndNotDisposed': {
58
- return this.__state.value;
59
- }
60
- case 'NotInParentCacheAndDisposed': {
61
- throw new Error('Attempted to access disposed value from CacheItem. ' +
62
- 'This indicates a bug in react-disposable-state.');
63
- }
64
- }
65
- }
66
- permanentRetainIfNotDisposed(disposeOfTemporaryRetain) {
67
- switch (this.__state.kind) {
68
- case 'InParentCacheAndNotDisposed': {
69
- let cleared = false;
70
- this.__state.permanentRetainCount++;
71
- disposeOfTemporaryRetain();
72
- return [
73
- this.__state.value,
74
- () => {
75
- if (cleared) {
76
- throw new Error('A permanent retain should only be cleared once. ' +
77
- 'This indicates a bug in react-disposable-state.');
78
- }
79
- cleared = true;
80
- switch (this.__state.kind) {
81
- case 'InParentCacheAndNotDisposed': {
82
- this.__state.permanentRetainCount--;
83
- this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
84
- return;
85
- }
86
- case 'NotInParentCacheAndNotDisposed': {
87
- this.__state.permanentRetainCount--;
88
- this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
89
- return;
90
- }
91
- case 'NotInParentCacheAndDisposed': {
92
- throw new Error('CacheItem was in a disposed state, but there existed a permanent retain. ' +
93
- 'This indicates a bug in react-disposable-state.');
94
- }
95
- }
96
- },
97
- ];
98
- }
99
- case 'NotInParentCacheAndNotDisposed': {
100
- let cleared = false;
101
- this.__state.permanentRetainCount++;
102
- disposeOfTemporaryRetain();
103
- return [
104
- this.__state.value,
105
- () => {
106
- if (cleared) {
107
- throw new Error('A permanent retain should only be cleared once. ' +
108
- 'This indicates a bug in react-disposable-state.');
109
- }
110
- cleared = true;
111
- switch (this.__state.kind) {
112
- case 'NotInParentCacheAndNotDisposed': {
113
- this.__state.permanentRetainCount--;
114
- this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
115
- return;
116
- }
117
- case 'InParentCacheAndNotDisposed':
118
- case 'NotInParentCacheAndDisposed': {
119
- throw new Error('CacheItem was in an unexpected state. ' +
120
- 'This indicates a bug in react-disposable-state.');
121
- }
122
- }
123
- },
124
- ];
125
- }
126
- case 'NotInParentCacheAndDisposed': {
127
- // The CacheItem is disposed, so disposeOfTemporaryRetain is a no-op
128
- return null;
129
- }
130
- }
131
- }
132
- temporaryRetain() {
133
- var _a, _b;
134
- switch (this.__state.kind) {
135
- case 'InParentCacheAndNotDisposed': {
136
- let status = 'Uncleared';
137
- this.__state.temporaryRetainCount++;
138
- const clearTemporaryRetainByCallack = () => {
139
- if (status === 'ClearedByCallback') {
140
- throw new Error('A temporary retain should only be cleared once. ' +
141
- 'This indicates a bug in react-disposable-state.');
142
- }
143
- else if (status === 'Uncleared') {
144
- switch (this.__state.kind) {
145
- case 'InParentCacheAndNotDisposed': {
146
- this.__state.temporaryRetainCount--;
147
- this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
148
- clearTimeout(timeoutId);
149
- return;
150
- }
151
- case 'NotInParentCacheAndDisposed':
152
- case 'NotInParentCacheAndNotDisposed': {
153
- throw new Error('A temporary retain was cleared, for which the CacheItem is in an invalid state. ' +
154
- 'This indicates a bug in react-disposable-state.');
155
- }
156
- }
157
- }
158
- };
159
- const clearTemporaryRetainByTimeout = () => {
160
- status = 'ClearedByTimeout';
161
- switch (this.__state.kind) {
162
- case 'InParentCacheAndNotDisposed': {
163
- this.__state.temporaryRetainCount--;
164
- this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
165
- return;
166
- }
167
- case 'NotInParentCacheAndDisposed':
168
- case 'NotInParentCacheAndNotDisposed': {
169
- throw new Error('A temporary retain was cleared, for which the CacheItem is in an invalid state. ' +
170
- 'This indicates a bug in react-disposable-state.');
171
- }
172
- }
173
- };
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);
175
- return clearTemporaryRetainByCallack;
176
- }
177
- case 'NotInParentCacheAndDisposed':
178
- case 'NotInParentCacheAndNotDisposed': {
179
- throw new Error('temporaryRetain was called, for which the CacheItem is in an invalid state. ' +
180
- 'This indicates a bug in react-disposable-state.');
181
- }
182
- }
183
- }
184
- permanentRetain() {
185
- switch (this.__state.kind) {
186
- case 'InParentCacheAndNotDisposed': {
187
- let cleared = false;
188
- this.__state.permanentRetainCount++;
189
- return () => {
190
- if (cleared) {
191
- throw new Error('A permanent retain should only be cleared once. ' +
192
- 'This indicates a bug in react-disposable-state.');
193
- }
194
- cleared = true;
195
- switch (this.__state.kind) {
196
- case 'InParentCacheAndNotDisposed': {
197
- this.__state.permanentRetainCount--;
198
- this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
199
- return;
200
- }
201
- case 'NotInParentCacheAndNotDisposed': {
202
- this.__state.permanentRetainCount--;
203
- this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
204
- return;
205
- }
206
- case 'NotInParentCacheAndDisposed': {
207
- throw new Error('CacheItem was in a disposed state, but there existed a permanent retain. ' +
208
- 'This indicates a bug in react-disposable-state.');
209
- }
210
- }
211
- };
212
- }
213
- case 'NotInParentCacheAndNotDisposed': {
214
- let cleared = false;
215
- this.__state.permanentRetainCount++;
216
- return () => {
217
- if (cleared) {
218
- throw new Error('A permanent retain should only be cleared once. ' +
219
- 'This indicates a bug in react-disposable-state.');
220
- }
221
- cleared = true;
222
- switch (this.__state.kind) {
223
- case 'NotInParentCacheAndNotDisposed': {
224
- this.__state.permanentRetainCount--;
225
- this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
226
- return;
227
- }
228
- case 'InParentCacheAndNotDisposed':
229
- case 'NotInParentCacheAndDisposed': {
230
- throw new Error('CacheItem was in an unexpected state. ' +
231
- 'This indicates a bug in react-disposable-state.');
232
- }
233
- }
234
- };
235
- }
236
- case 'NotInParentCacheAndDisposed': {
237
- throw new Error('permanentRetain was called, but the CacheItem is in an invalid state. ' +
238
- 'This indicates a bug in react-disposable-state.');
239
- }
240
- }
241
- }
242
- __maybeExitInParentCacheAndNotDisposedState(state) {
243
- if (state.temporaryRetainCount === 0 && state.permanentRetainCount === 0) {
244
- state.removeFromParentCache();
245
- state.disposeValue();
246
- this.__state = {
247
- kind: 'NotInParentCacheAndDisposed',
248
- };
249
- }
250
- else if (state.temporaryRetainCount === 0) {
251
- state.removeFromParentCache();
252
- this.__state = {
253
- kind: 'NotInParentCacheAndNotDisposed',
254
- value: state.value,
255
- disposeValue: state.disposeValue,
256
- permanentRetainCount: state.permanentRetainCount,
257
- };
258
- }
259
- }
260
- __maybeExitNotInParentCacheAndNotDisposedState(state) {
261
- if (state.permanentRetainCount === 0) {
262
- state.disposeValue();
263
- this.__state = {
264
- kind: 'NotInParentCacheAndDisposed',
265
- };
266
- }
267
- }
268
- }
269
- exports.CacheItem = CacheItem;
5
+ * CacheItem:
6
+ *
7
+ * Terminology:
8
+ * - TRC = Temporary Retain Count
9
+ * - PRC = Permanent Retain Count
10
+ *
11
+ * A CacheItem<T> can be in three states:
12
+ * In parent cache? | Item disposed? | TRC | PRC | Name
13
+ * -----------------+----------------+-----+-----+-------------------------------
14
+ * In parent cache | Not disposed | >0 | >=0 | InParentCacheAndNotDisposed
15
+ * Removed | Not disposed | 0 | >0 | NotInParentCacheAndNotDisposed
16
+ * Removed | Disposed | 0 | 0 | NotInParentCacheAndNotDisposed
17
+ *
18
+ * A cache item can only move down rows. As in, if its in the parent cache,
19
+ * it can be removed. It can never be replaced in the parent cache. (If a
20
+ * parent cache becomes full again, it will contain a new CacheItem.) The
21
+ * contained item can be disposed, but never un-disposed.
22
+ *
23
+ * So, the valid transitions are:
24
+ * - InParentCacheAndNotDisposed => NotInParentCacheAndNotDisposed
25
+ * - InParentCacheAndNotDisposed => NotInParentCacheAndDisposed
26
+ * - NotInParentCacheAndNotDisposed => NotInParentCacheAndDisposed
27
+ */
28
+ var CacheItem = class {
29
+ constructor(factory, removeFromParentCache, options) {
30
+ this.__options = options ?? null;
31
+ const [value, disposeValue] = factory();
32
+ this.__state = {
33
+ kind: "InParentCacheAndNotDisposed",
34
+ value,
35
+ disposeValue,
36
+ removeFromParentCache,
37
+ temporaryRetainCount: 0,
38
+ permanentRetainCount: 0
39
+ };
40
+ }
41
+ getValue() {
42
+ switch (this.__state.kind) {
43
+ case "InParentCacheAndNotDisposed": return this.__state.value;
44
+ case "NotInParentCacheAndNotDisposed": return this.__state.value;
45
+ case "NotInParentCacheAndDisposed": throw new Error("Attempted to access disposed value from CacheItem. This indicates a bug in react-disposable-state.");
46
+ }
47
+ }
48
+ permanentRetainIfNotDisposed(disposeOfTemporaryRetain) {
49
+ switch (this.__state.kind) {
50
+ case "InParentCacheAndNotDisposed": {
51
+ let cleared = false;
52
+ this.__state.permanentRetainCount++;
53
+ disposeOfTemporaryRetain();
54
+ return [this.__state.value, () => {
55
+ if (cleared) throw new Error("A permanent retain should only be cleared once. This indicates a bug in react-disposable-state.");
56
+ cleared = true;
57
+ switch (this.__state.kind) {
58
+ case "InParentCacheAndNotDisposed":
59
+ this.__state.permanentRetainCount--;
60
+ this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
61
+ return;
62
+ case "NotInParentCacheAndNotDisposed":
63
+ this.__state.permanentRetainCount--;
64
+ this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
65
+ return;
66
+ case "NotInParentCacheAndDisposed": throw new Error("CacheItem was in a disposed state, but there existed a permanent retain. This indicates a bug in react-disposable-state.");
67
+ }
68
+ }];
69
+ }
70
+ case "NotInParentCacheAndNotDisposed": {
71
+ let cleared = false;
72
+ this.__state.permanentRetainCount++;
73
+ disposeOfTemporaryRetain();
74
+ return [this.__state.value, () => {
75
+ if (cleared) throw new Error("A permanent retain should only be cleared once. This indicates a bug in react-disposable-state.");
76
+ cleared = true;
77
+ switch (this.__state.kind) {
78
+ case "NotInParentCacheAndNotDisposed":
79
+ this.__state.permanentRetainCount--;
80
+ this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
81
+ return;
82
+ case "InParentCacheAndNotDisposed":
83
+ case "NotInParentCacheAndDisposed": throw new Error("CacheItem was in an unexpected state. This indicates a bug in react-disposable-state.");
84
+ }
85
+ }];
86
+ }
87
+ case "NotInParentCacheAndDisposed": return null;
88
+ }
89
+ }
90
+ temporaryRetain() {
91
+ switch (this.__state.kind) {
92
+ case "InParentCacheAndNotDisposed": {
93
+ let status = "Uncleared";
94
+ this.__state.temporaryRetainCount++;
95
+ const clearTemporaryRetainByCallack = () => {
96
+ if (status === "ClearedByCallback") throw new Error("A temporary retain should only be cleared once. This indicates a bug in react-disposable-state.");
97
+ else if (status === "Uncleared") switch (this.__state.kind) {
98
+ case "InParentCacheAndNotDisposed":
99
+ this.__state.temporaryRetainCount--;
100
+ this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
101
+ clearTimeout(timeoutId);
102
+ return;
103
+ case "NotInParentCacheAndDisposed":
104
+ case "NotInParentCacheAndNotDisposed": throw new Error("A temporary retain was cleared, for which the CacheItem is in an invalid state. This indicates a bug in react-disposable-state.");
105
+ }
106
+ };
107
+ const clearTemporaryRetainByTimeout = () => {
108
+ status = "ClearedByTimeout";
109
+ switch (this.__state.kind) {
110
+ case "InParentCacheAndNotDisposed":
111
+ this.__state.temporaryRetainCount--;
112
+ this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
113
+ return;
114
+ case "NotInParentCacheAndDisposed":
115
+ case "NotInParentCacheAndNotDisposed": throw new Error("A temporary retain was cleared, for which the CacheItem is in an invalid state. This indicates a bug in react-disposable-state.");
116
+ }
117
+ };
118
+ const timeoutId = setTimeout(clearTemporaryRetainByTimeout, this.__options?.temporaryRetainTime ?? DEFAULT_TEMPORARY_RETAIN_TIME);
119
+ return clearTemporaryRetainByCallack;
120
+ }
121
+ case "NotInParentCacheAndDisposed":
122
+ case "NotInParentCacheAndNotDisposed": throw new Error("temporaryRetain was called, for which the CacheItem is in an invalid state. This indicates a bug in react-disposable-state.");
123
+ }
124
+ }
125
+ permanentRetain() {
126
+ switch (this.__state.kind) {
127
+ case "InParentCacheAndNotDisposed": {
128
+ let cleared = false;
129
+ this.__state.permanentRetainCount++;
130
+ return () => {
131
+ if (cleared) throw new Error("A permanent retain should only be cleared once. This indicates a bug in react-disposable-state.");
132
+ cleared = true;
133
+ switch (this.__state.kind) {
134
+ case "InParentCacheAndNotDisposed":
135
+ this.__state.permanentRetainCount--;
136
+ this.__maybeExitInParentCacheAndNotDisposedState(this.__state);
137
+ return;
138
+ case "NotInParentCacheAndNotDisposed":
139
+ this.__state.permanentRetainCount--;
140
+ this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
141
+ return;
142
+ case "NotInParentCacheAndDisposed": throw new Error("CacheItem was in a disposed state, but there existed a permanent retain. This indicates a bug in react-disposable-state.");
143
+ }
144
+ };
145
+ }
146
+ case "NotInParentCacheAndNotDisposed": {
147
+ let cleared = false;
148
+ this.__state.permanentRetainCount++;
149
+ return () => {
150
+ if (cleared) throw new Error("A permanent retain should only be cleared once. This indicates a bug in react-disposable-state.");
151
+ cleared = true;
152
+ switch (this.__state.kind) {
153
+ case "NotInParentCacheAndNotDisposed":
154
+ this.__state.permanentRetainCount--;
155
+ this.__maybeExitNotInParentCacheAndNotDisposedState(this.__state);
156
+ return;
157
+ case "InParentCacheAndNotDisposed":
158
+ case "NotInParentCacheAndDisposed": throw new Error("CacheItem was in an unexpected state. This indicates a bug in react-disposable-state.");
159
+ }
160
+ };
161
+ }
162
+ case "NotInParentCacheAndDisposed": throw new Error("permanentRetain was called, but the CacheItem is in an invalid state. This indicates a bug in react-disposable-state.");
163
+ }
164
+ }
165
+ __maybeExitInParentCacheAndNotDisposedState(state) {
166
+ if (state.temporaryRetainCount === 0 && state.permanentRetainCount === 0) {
167
+ state.removeFromParentCache();
168
+ state.disposeValue();
169
+ this.__state = { kind: "NotInParentCacheAndDisposed" };
170
+ } else if (state.temporaryRetainCount === 0) {
171
+ state.removeFromParentCache();
172
+ this.__state = {
173
+ kind: "NotInParentCacheAndNotDisposed",
174
+ value: state.value,
175
+ disposeValue: state.disposeValue,
176
+ permanentRetainCount: state.permanentRetainCount
177
+ };
178
+ }
179
+ }
180
+ __maybeExitNotInParentCacheAndNotDisposedState(state) {
181
+ if (state.permanentRetainCount === 0) {
182
+ state.disposeValue();
183
+ this.__state = { kind: "NotInParentCacheAndDisposed" };
184
+ }
185
+ }
186
+ };
270
187
  function createTemporarilyRetainedCacheItem(factory, removeFromParentCache, options) {
271
- const cacheItem = new CacheItem(factory, removeFromParentCache, options);
272
- const disposeTemporaryRetain = cacheItem.temporaryRetain();
273
- return [cacheItem, disposeTemporaryRetain];
188
+ const cacheItem = new CacheItem(factory, removeFromParentCache, options);
189
+ return [cacheItem, cacheItem.temporaryRetain()];
274
190
  }
191
+
192
+ //#endregion
193
+ exports.CacheItem = CacheItem;
194
+ exports.createTemporarilyRetainedCacheItem = createTemporarilyRetainedCacheItem;