@lmvz-ds/components 0.13.0 → 0.13.2
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/{esm/assets-ozES4zSA.js → cjs/Effect-CpZhfb0D.js} +5538 -1194
- package/dist/cjs/aria-loader-BhgXpCuo.js +77 -0
- package/dist/cjs/assets-BnJmIx_h.js +26 -0
- package/dist/cjs/{icons-DM_TTn48.js → icons-Brr4vqiE.js} +165 -369
- package/dist/cjs/{index-D3BMpL5w.js → index-9ZJx0550.js} +3 -0
- package/dist/cjs/index-BVxGxK9i.js +35629 -0
- package/dist/cjs/index.cjs.js +12 -4
- package/dist/cjs/lmvz-action.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-button.cjs.entry.js +6 -3
- package/dist/cjs/lmvz-card.cjs.entry.js +4 -4
- package/dist/cjs/lmvz-chip.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-components.cjs.js +1 -1
- package/dist/cjs/lmvz-header.cjs.entry.js +8 -5
- package/dist/cjs/lmvz-icon.cjs.entry.js +20 -9
- package/dist/cjs/lmvz-input.cjs.entry.js +8 -5
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +7 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{reactive-controller-host-BMDEj1kX.js → reactive-controller-host-t3uLq_s2.js} +71 -50
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -1
- package/dist/collection/components/lmvz-card/lmvz-card.js +3 -4
- package/dist/collection/components/lmvz-header/lmvz-header.js +5 -3
- package/dist/collection/components/lmvz-icon/icons.js +2 -2
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +14 -5
- package/dist/collection/components/lmvz-input/lmvz-input.js +5 -3
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +4 -2
- package/dist/collection/index.js +1 -0
- package/dist/collection/integration/header-integration.js +1 -3
- package/dist/collection/utils/aria/aria-validation-controller.js +68 -27
- package/dist/collection/utils/assets.js +9 -6
- package/dist/collection/utils/http.js +2 -2
- package/dist/collection/utils/http.unit.js +1 -1
- package/dist/collection/utils/validation/svg.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-action.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-chip.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/p-B68hOTYN.js +12 -0
- package/dist/components/p-BaPwpeMs.js +1 -0
- package/dist/components/p-CSRpdnrt.js +1 -0
- package/dist/components/p-DFXwtZsD.js +1 -0
- package/dist/components/p-DcMNH3fv.js +1 -0
- package/dist/components/p-dQa_lGo8.js +1 -0
- package/dist/{cjs/assets-CB5ikzmP.js → esm/Effect-DyamyJqO.js} +5329 -1266
- package/dist/esm/aria-loader-BQXogs4-.js +70 -0
- package/dist/esm/assets-CvV1KMMV.js +23 -0
- package/dist/esm/{icons-kpJZ1u9g.js → icons-C69Um2xB.js} +69 -273
- package/dist/esm/index-BRxn9h5l.js +35626 -0
- package/dist/esm/{index-T5ljELGS.js → index-smGPjoDX.js} +3 -1
- package/dist/esm/index.js +5 -3
- package/dist/esm/lmvz-action.entry.js +1 -1
- package/dist/esm/lmvz-button.entry.js +6 -3
- package/dist/esm/lmvz-card.entry.js +4 -4
- package/dist/esm/lmvz-chip.entry.js +1 -1
- package/dist/esm/lmvz-components.js +2 -2
- package/dist/esm/lmvz-header.entry.js +8 -5
- package/dist/esm/lmvz-icon.entry.js +20 -9
- package/dist/esm/lmvz-input.entry.js +8 -5
- package/dist/esm/lmvz-menuitem.entry.js +7 -4
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{reactive-controller-host-CZ3dGAjR.js → reactive-controller-host-puHvKP9Y.js} +65 -44
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-0e5aa1a3.entry.js +1 -0
- package/dist/lmvz-components/p-0f930140.entry.js +1 -0
- package/dist/lmvz-components/p-2df3646d.entry.js +1 -0
- package/dist/lmvz-components/p-470f6f56.entry.js +1 -0
- package/dist/lmvz-components/p-67af4826.entry.js +1 -0
- package/dist/lmvz-components/p-775b737d.entry.js +1 -0
- package/dist/lmvz-components/{p-feda2ec5.entry.js → p-9faac8f3.entry.js} +1 -1
- package/dist/lmvz-components/p-BEoSvNlI.js +1 -0
- package/dist/lmvz-components/p-D7GrtdQF.js +1 -0
- package/dist/lmvz-components/p-DJp2UHon.js +12 -0
- package/dist/lmvz-components/p-DWVncv6N.js +1 -0
- package/dist/lmvz-components/p-DyamyJqO.js +1 -0
- package/dist/lmvz-components/{p-980688a0.entry.js → p-d4b68381.entry.js} +1 -1
- package/dist/lmvz-components/p-qPGwETYT.js +1 -0
- package/dist/lmvz-components/p-smGPjoDX.js +2 -0
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +1 -0
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +1 -0
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +3 -0
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +2 -1
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +3 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/aria/aria-validation-controller.d.ts +8 -2
- package/dist/types/utils/assets.d.ts +1 -8
- package/dist/types/utils/http.d.ts +3 -3
- package/dist/types/utils/validation/svg.d.ts +2 -2
- package/hydrate/index.js +2225 -12448
- package/hydrate/index.mjs +2225 -12448
- package/package.json +6 -8
- package/dist/components/p-BBDH9X49.js +0 -1
- package/dist/components/p-Bs6_m7Uw.js +0 -1
- package/dist/components/p-CMteT-Yo.js +0 -1
- package/dist/components/p-vi4YzJmv.js +0 -1
- package/dist/lmvz-components/p-16878d4c.entry.js +0 -1
- package/dist/lmvz-components/p-4ad8c332.entry.js +0 -1
- package/dist/lmvz-components/p-5eee0752.entry.js +0 -1
- package/dist/lmvz-components/p-8ea1a349.entry.js +0 -1
- package/dist/lmvz-components/p-CZ3dGAjR.js +0 -1
- package/dist/lmvz-components/p-D9lc4ayG.js +0 -1
- package/dist/lmvz-components/p-T5ljELGS.js +0 -2
- package/dist/lmvz-components/p-a34542fa.entry.js +0 -1
- package/dist/lmvz-components/p-d2bf6a3f.entry.js +0 -1
- package/dist/lmvz-components/p-iviTjlUy.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var Effect = require('./Effect-CpZhfb0D.js');
|
|
4
|
+
var assets = require('./assets-BnJmIx_h.js');
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* This module provides types and utility functions to create and work with branded types,
|
|
@@ -36,274 +37,22 @@ const error = (message, meta) => [{
|
|
|
36
37
|
meta
|
|
37
38
|
}];
|
|
38
39
|
function refined(...args) {
|
|
39
|
-
const either = args.length === 2 ? unbranded => args[0](unbranded) ?
|
|
40
|
-
return
|
|
41
|
-
onNone: () =>
|
|
42
|
-
onSome:
|
|
40
|
+
const either = args.length === 2 ? unbranded => args[0](unbranded) ? Effect.right(unbranded) : Effect.left(args[1](unbranded)) : unbranded => {
|
|
41
|
+
return Effect.match(args[0](unbranded), {
|
|
42
|
+
onNone: () => Effect.right(unbranded),
|
|
43
|
+
onSome: Effect.left
|
|
43
44
|
});
|
|
44
45
|
};
|
|
45
|
-
return Object.assign(unbranded =>
|
|
46
|
+
return Object.assign(unbranded => Effect.getOrThrowWith(either(unbranded), Effect.identity), {
|
|
46
47
|
[RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
|
|
47
|
-
option: args =>
|
|
48
|
+
option: args => Effect.getRight(either(args)),
|
|
48
49
|
either,
|
|
49
|
-
is: args =>
|
|
50
|
+
is: args => Effect.isRight(either(args))
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
const _await = assets.deferredAwait;
|
|
54
|
-
/**
|
|
55
|
-
* Exits the `Deferred` with the specified `Exit` value, which will be
|
|
56
|
-
* propagated to all fibers waiting on the value of the `Deferred`.
|
|
57
|
-
*
|
|
58
|
-
* @since 2.0.0
|
|
59
|
-
* @category utils
|
|
60
|
-
*/
|
|
61
|
-
const done = assets.deferredDone;
|
|
62
|
-
/**
|
|
63
|
-
* Completes the `Deferred` with interruption. This will interrupt all fibers
|
|
64
|
-
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
|
|
65
|
-
* calling this method.
|
|
66
|
-
*
|
|
67
|
-
* @since 2.0.0
|
|
68
|
-
* @category utils
|
|
69
|
-
*/
|
|
70
|
-
const interrupt = assets.deferredInterrupt;
|
|
71
|
-
/**
|
|
72
|
-
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
|
73
|
-
*
|
|
74
|
-
* @since 2.0.0
|
|
75
|
-
* @category unsafe
|
|
76
|
-
*/
|
|
77
|
-
const unsafeMake = assets.deferredUnsafeMake;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
|
81
|
-
*
|
|
82
|
-
* @since 2.0.0
|
|
83
|
-
* @category constructors
|
|
84
|
-
*/
|
|
85
|
-
const succeed = assets.exitSucceed;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @since 2.0.0
|
|
89
|
-
*/
|
|
90
|
-
const TypeId$1 = /*#__PURE__*/Symbol.for("effect/MutableList");
|
|
91
|
-
const MutableListProto = {
|
|
92
|
-
[TypeId$1]: TypeId$1,
|
|
93
|
-
[Symbol.iterator]() {
|
|
94
|
-
let done = false;
|
|
95
|
-
let head = this.head;
|
|
96
|
-
return {
|
|
97
|
-
next() {
|
|
98
|
-
if (done) {
|
|
99
|
-
return this.return();
|
|
100
|
-
}
|
|
101
|
-
if (head == null) {
|
|
102
|
-
done = true;
|
|
103
|
-
return this.return();
|
|
104
|
-
}
|
|
105
|
-
const value = head.value;
|
|
106
|
-
head = head.next;
|
|
107
|
-
return {
|
|
108
|
-
done,
|
|
109
|
-
value
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
return(value) {
|
|
113
|
-
if (!done) {
|
|
114
|
-
done = true;
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
done: true,
|
|
118
|
-
value
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
toString() {
|
|
124
|
-
return assets.format(this.toJSON());
|
|
125
|
-
},
|
|
126
|
-
toJSON() {
|
|
127
|
-
return {
|
|
128
|
-
_id: "MutableList",
|
|
129
|
-
values: Array.from(this).map(assets.toJSON)
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
[assets.NodeInspectSymbol]() {
|
|
133
|
-
return this.toJSON();
|
|
134
|
-
},
|
|
135
|
-
pipe() {
|
|
136
|
-
return assets.pipeArguments(this, arguments);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
/** @internal */
|
|
140
|
-
const makeNode = value => ({
|
|
141
|
-
value,
|
|
142
|
-
removed: false,
|
|
143
|
-
prev: undefined,
|
|
144
|
-
next: undefined
|
|
145
|
-
});
|
|
146
|
-
/**
|
|
147
|
-
* Creates an empty `MutableList`.
|
|
148
|
-
*
|
|
149
|
-
* @since 2.0.0
|
|
150
|
-
* @category constructors
|
|
151
|
-
*/
|
|
152
|
-
const empty = () => {
|
|
153
|
-
const list = Object.create(MutableListProto);
|
|
154
|
-
list.head = undefined;
|
|
155
|
-
list.tail = undefined;
|
|
156
|
-
list._length = 0;
|
|
157
|
-
return list;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Returns `true` if the list contains zero elements, `false`, otherwise.
|
|
161
|
-
*
|
|
162
|
-
* @since 2.0.0
|
|
163
|
-
* @category getters
|
|
164
|
-
*/
|
|
165
|
-
const isEmpty = self => length(self) === 0;
|
|
166
|
-
/**
|
|
167
|
-
* Returns the length of the list.
|
|
168
|
-
*
|
|
169
|
-
* @since 2.0.0
|
|
170
|
-
* @category getters
|
|
171
|
-
*/
|
|
172
|
-
const length = self => self._length;
|
|
173
|
-
/**
|
|
174
|
-
* Appends the specified element to the end of the `MutableList`.
|
|
175
|
-
*
|
|
176
|
-
* @category concatenating
|
|
177
|
-
* @since 2.0.0
|
|
178
|
-
*/
|
|
179
|
-
const append = /*#__PURE__*/assets.dual(2, (self, value) => {
|
|
180
|
-
const node = makeNode(value);
|
|
181
|
-
if (self.head === undefined) {
|
|
182
|
-
self.head = node;
|
|
183
|
-
}
|
|
184
|
-
if (self.tail === undefined) {
|
|
185
|
-
self.tail = node;
|
|
186
|
-
} else {
|
|
187
|
-
self.tail.next = node;
|
|
188
|
-
node.prev = self.tail;
|
|
189
|
-
self.tail = node;
|
|
190
|
-
}
|
|
191
|
-
self._length += 1;
|
|
192
|
-
return self;
|
|
193
|
-
});
|
|
194
|
-
/**
|
|
195
|
-
* Removes the first value from the list and returns it, if it exists.
|
|
196
|
-
*
|
|
197
|
-
* @since 0.0.1
|
|
198
|
-
*/
|
|
199
|
-
const shift = self => {
|
|
200
|
-
const head = self.head;
|
|
201
|
-
if (head !== undefined) {
|
|
202
|
-
remove(self, head);
|
|
203
|
-
return head.value;
|
|
204
|
-
}
|
|
205
|
-
return undefined;
|
|
206
|
-
};
|
|
207
|
-
const remove = (self, node) => {
|
|
208
|
-
if (node.removed) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
node.removed = true;
|
|
212
|
-
if (node.prev !== undefined && node.next !== undefined) {
|
|
213
|
-
node.prev.next = node.next;
|
|
214
|
-
node.next.prev = node.prev;
|
|
215
|
-
} else if (node.prev !== undefined) {
|
|
216
|
-
self.tail = node.prev;
|
|
217
|
-
node.prev.next = undefined;
|
|
218
|
-
} else if (node.next !== undefined) {
|
|
219
|
-
self.head = node.next;
|
|
220
|
-
node.next.prev = undefined;
|
|
221
|
-
} else {
|
|
222
|
-
self.tail = undefined;
|
|
223
|
-
self.head = undefined;
|
|
224
|
-
}
|
|
225
|
-
if (self._length > 0) {
|
|
226
|
-
self._length -= 1;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @since 2.0.0
|
|
232
|
-
*/
|
|
233
|
-
const TypeId = /*#__PURE__*/Symbol.for("effect/MutableQueue");
|
|
234
|
-
/**
|
|
235
|
-
* @since 2.0.0
|
|
236
|
-
* @category symbol
|
|
237
|
-
*/
|
|
238
|
-
const EmptyMutableQueue = /*#__PURE__*/Symbol.for("effect/mutable/MutableQueue/Empty");
|
|
239
|
-
const MutableQueueProto = {
|
|
240
|
-
[TypeId]: TypeId,
|
|
241
|
-
[Symbol.iterator]() {
|
|
242
|
-
return Array.from(this.queue)[Symbol.iterator]();
|
|
243
|
-
},
|
|
244
|
-
toString() {
|
|
245
|
-
return assets.format(this.toJSON());
|
|
246
|
-
},
|
|
247
|
-
toJSON() {
|
|
248
|
-
return {
|
|
249
|
-
_id: "MutableQueue",
|
|
250
|
-
values: Array.from(this).map(assets.toJSON)
|
|
251
|
-
};
|
|
252
|
-
},
|
|
253
|
-
[assets.NodeInspectSymbol]() {
|
|
254
|
-
return this.toJSON();
|
|
255
|
-
},
|
|
256
|
-
pipe() {
|
|
257
|
-
return assets.pipeArguments(this, arguments);
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
const make$2 = capacity => {
|
|
261
|
-
const queue = Object.create(MutableQueueProto);
|
|
262
|
-
queue.queue = empty();
|
|
263
|
-
queue.capacity = capacity;
|
|
264
|
-
return queue;
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* Creates a new unbounded `MutableQueue`.
|
|
268
|
-
*
|
|
269
|
-
* @since 2.0.0
|
|
270
|
-
* @category constructors
|
|
271
|
-
*/
|
|
272
|
-
const unbounded = () => make$2(undefined);
|
|
273
|
-
/**
|
|
274
|
-
* Offers an element to the queue.
|
|
275
|
-
*
|
|
276
|
-
* Returns whether the enqueue was successful or not.
|
|
277
|
-
*
|
|
278
|
-
* @since 2.0.0
|
|
279
|
-
*/
|
|
280
|
-
const offer = /*#__PURE__*/assets.dual(2, (self, value) => {
|
|
281
|
-
const queueLength = length(self.queue);
|
|
282
|
-
if (self.capacity !== undefined && queueLength === self.capacity) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
append(value)(self.queue);
|
|
286
|
-
return true;
|
|
287
|
-
});
|
|
288
|
-
/**
|
|
289
|
-
* Dequeues an element from the queue.
|
|
290
|
-
*
|
|
291
|
-
* Returns either an element from the queue, or the `def` param.
|
|
292
|
-
*
|
|
293
|
-
* **Note**: if there is no meaningful default for your type, you can always
|
|
294
|
-
* use `poll(MutableQueue.EmptyMutableQueue)`.
|
|
295
|
-
*
|
|
296
|
-
* @since 2.0.0
|
|
297
|
-
*/
|
|
298
|
-
const poll = /*#__PURE__*/assets.dual(2, (self, def) => {
|
|
299
|
-
if (isEmpty(self.queue)) {
|
|
300
|
-
return def;
|
|
301
|
-
}
|
|
302
|
-
return shift(self.queue);
|
|
303
|
-
});
|
|
304
|
-
|
|
305
54
|
/** @internal */
|
|
306
|
-
const complete = (key, exit, entryStats, timeToLiveMillis) =>
|
|
55
|
+
const complete = (key, exit, entryStats, timeToLiveMillis) => Effect.struct({
|
|
307
56
|
_tag: "Complete",
|
|
308
57
|
key,
|
|
309
58
|
exit,
|
|
@@ -311,13 +60,13 @@ const complete = (key, exit, entryStats, timeToLiveMillis) => assets.struct({
|
|
|
311
60
|
timeToLiveMillis
|
|
312
61
|
});
|
|
313
62
|
/** @internal */
|
|
314
|
-
const pending = (key, deferred) =>
|
|
63
|
+
const pending = (key, deferred) => Effect.struct({
|
|
315
64
|
_tag: "Pending",
|
|
316
65
|
key,
|
|
317
66
|
deferred
|
|
318
67
|
});
|
|
319
68
|
/** @internal */
|
|
320
|
-
const refreshing = (deferred, complete) =>
|
|
69
|
+
const refreshing = (deferred, complete) => Effect.struct({
|
|
321
70
|
_tag: "Refreshing",
|
|
322
71
|
deferred,
|
|
323
72
|
complete
|
|
@@ -332,20 +81,20 @@ class MapKeyImpl {
|
|
|
332
81
|
constructor(current) {
|
|
333
82
|
this.current = current;
|
|
334
83
|
}
|
|
335
|
-
[
|
|
336
|
-
return
|
|
84
|
+
[Effect.symbol]() {
|
|
85
|
+
return Effect.pipe(Effect.hash(this.current), Effect.combine(Effect.hash(this.previous)), Effect.combine(Effect.hash(this.next)), Effect.cached(this));
|
|
337
86
|
}
|
|
338
|
-
[
|
|
87
|
+
[Effect.symbol$1](that) {
|
|
339
88
|
if (this === that) {
|
|
340
89
|
return true;
|
|
341
90
|
}
|
|
342
|
-
return isMapKey(that) &&
|
|
91
|
+
return isMapKey(that) && Effect.equals(this.current, that.current) && Effect.equals(this.previous, that.previous) && Effect.equals(this.next, that.next);
|
|
343
92
|
}
|
|
344
93
|
}
|
|
345
94
|
/** @internal */
|
|
346
95
|
const makeMapKey = current => new MapKeyImpl(current);
|
|
347
96
|
/** @internal */
|
|
348
|
-
const isMapKey = u =>
|
|
97
|
+
const isMapKey = u => Effect.hasProperty(u, MapKeyTypeId);
|
|
349
98
|
class KeySetImpl {
|
|
350
99
|
head = undefined;
|
|
351
100
|
tail = undefined;
|
|
@@ -409,7 +158,7 @@ const makeCacheState = (map, keys, accesses, updating, hits, misses) => ({
|
|
|
409
158
|
*
|
|
410
159
|
* @internal
|
|
411
160
|
*/
|
|
412
|
-
const initialCacheState = () => makeCacheState(
|
|
161
|
+
const initialCacheState = () => makeCacheState(Effect.empty(), makeKeySet(), Effect.unbounded(), Effect.make(false), 0, 0);
|
|
413
162
|
/** @internal */
|
|
414
163
|
const CacheSymbolKey = "effect/Cache";
|
|
415
164
|
/** @internal */
|
|
@@ -458,177 +207,177 @@ class CacheImpl {
|
|
|
458
207
|
this.cacheState = initialCacheState();
|
|
459
208
|
}
|
|
460
209
|
get(key) {
|
|
461
|
-
return
|
|
210
|
+
return Effect.map(this.getEither(key), Effect.merge);
|
|
462
211
|
}
|
|
463
212
|
get cacheStats() {
|
|
464
|
-
return
|
|
213
|
+
return Effect.sync(() => makeCacheStats({
|
|
465
214
|
hits: this.cacheState.hits,
|
|
466
215
|
misses: this.cacheState.misses,
|
|
467
|
-
size:
|
|
216
|
+
size: Effect.size(this.cacheState.map)
|
|
468
217
|
}));
|
|
469
218
|
}
|
|
470
219
|
getOption(key) {
|
|
471
|
-
return
|
|
220
|
+
return Effect.suspend(() => Effect.match(Effect.get(this.cacheState.map, key), {
|
|
472
221
|
onNone: () => {
|
|
473
222
|
const mapKey = makeMapKey(key);
|
|
474
223
|
this.trackAccess(mapKey);
|
|
475
224
|
this.trackMiss();
|
|
476
|
-
return
|
|
225
|
+
return Effect.succeed$1(Effect.none());
|
|
477
226
|
},
|
|
478
227
|
onSome: value => this.resolveMapValue(value)
|
|
479
228
|
}));
|
|
480
229
|
}
|
|
481
230
|
getOptionComplete(key) {
|
|
482
|
-
return
|
|
231
|
+
return Effect.suspend(() => Effect.match(Effect.get(this.cacheState.map, key), {
|
|
483
232
|
onNone: () => {
|
|
484
233
|
const mapKey = makeMapKey(key);
|
|
485
234
|
this.trackAccess(mapKey);
|
|
486
235
|
this.trackMiss();
|
|
487
|
-
return
|
|
236
|
+
return Effect.succeed$1(Effect.none());
|
|
488
237
|
},
|
|
489
238
|
onSome: value => this.resolveMapValue(value, true)
|
|
490
239
|
}));
|
|
491
240
|
}
|
|
492
241
|
contains(key) {
|
|
493
|
-
return
|
|
242
|
+
return Effect.sync(() => Effect.has(this.cacheState.map, key));
|
|
494
243
|
}
|
|
495
244
|
entryStats(key) {
|
|
496
|
-
return
|
|
497
|
-
const option =
|
|
498
|
-
if (
|
|
245
|
+
return Effect.sync(() => {
|
|
246
|
+
const option = Effect.get(this.cacheState.map, key);
|
|
247
|
+
if (Effect.isSome(option)) {
|
|
499
248
|
switch (option.value._tag) {
|
|
500
249
|
case "Complete":
|
|
501
250
|
{
|
|
502
251
|
const loaded = option.value.entryStats.loadedMillis;
|
|
503
|
-
return
|
|
252
|
+
return Effect.some(makeEntryStats(loaded));
|
|
504
253
|
}
|
|
505
254
|
case "Pending":
|
|
506
255
|
{
|
|
507
|
-
return
|
|
256
|
+
return Effect.none();
|
|
508
257
|
}
|
|
509
258
|
case "Refreshing":
|
|
510
259
|
{
|
|
511
260
|
const loaded = option.value.complete.entryStats.loadedMillis;
|
|
512
|
-
return
|
|
261
|
+
return Effect.some(makeEntryStats(loaded));
|
|
513
262
|
}
|
|
514
263
|
}
|
|
515
264
|
}
|
|
516
|
-
return
|
|
265
|
+
return Effect.none();
|
|
517
266
|
});
|
|
518
267
|
}
|
|
519
268
|
getEither(key) {
|
|
520
|
-
return
|
|
269
|
+
return Effect.suspend(() => {
|
|
521
270
|
const k = key;
|
|
522
271
|
let mapKey = undefined;
|
|
523
272
|
let deferred = undefined;
|
|
524
|
-
let value =
|
|
273
|
+
let value = Effect.getOrUndefined(Effect.get(this.cacheState.map, k));
|
|
525
274
|
if (value === undefined) {
|
|
526
|
-
deferred = unsafeMake(this.fiberId);
|
|
275
|
+
deferred = Effect.unsafeMake(this.fiberId);
|
|
527
276
|
mapKey = makeMapKey(k);
|
|
528
|
-
if (
|
|
529
|
-
value =
|
|
277
|
+
if (Effect.has(this.cacheState.map, k)) {
|
|
278
|
+
value = Effect.getOrUndefined(Effect.get(this.cacheState.map, k));
|
|
530
279
|
} else {
|
|
531
|
-
|
|
280
|
+
Effect.set(this.cacheState.map, k, pending(mapKey, deferred));
|
|
532
281
|
}
|
|
533
282
|
}
|
|
534
283
|
if (value === undefined) {
|
|
535
284
|
this.trackAccess(mapKey);
|
|
536
285
|
this.trackMiss();
|
|
537
|
-
return
|
|
286
|
+
return Effect.map(this.lookupValueOf(key, deferred), Effect.right);
|
|
538
287
|
} else {
|
|
539
|
-
return
|
|
288
|
+
return Effect.flatMap(this.resolveMapValue(value), Effect.match({
|
|
540
289
|
onNone: () => this.getEither(key),
|
|
541
|
-
onSome: value =>
|
|
290
|
+
onSome: value => Effect.succeed$1(Effect.left(value))
|
|
542
291
|
}));
|
|
543
292
|
}
|
|
544
293
|
});
|
|
545
294
|
}
|
|
546
295
|
invalidate(key) {
|
|
547
|
-
return
|
|
548
|
-
|
|
296
|
+
return Effect.sync(() => {
|
|
297
|
+
Effect.remove(this.cacheState.map, key);
|
|
549
298
|
});
|
|
550
299
|
}
|
|
551
300
|
invalidateWhen(key, when) {
|
|
552
|
-
return
|
|
553
|
-
const value =
|
|
554
|
-
if (
|
|
301
|
+
return Effect.sync(() => {
|
|
302
|
+
const value = Effect.get(this.cacheState.map, key);
|
|
303
|
+
if (Effect.isSome(value) && value.value._tag === "Complete") {
|
|
555
304
|
if (value.value.exit._tag === "Success") {
|
|
556
305
|
if (when(value.value.exit.value)) {
|
|
557
|
-
|
|
306
|
+
Effect.remove(this.cacheState.map, key);
|
|
558
307
|
}
|
|
559
308
|
}
|
|
560
309
|
}
|
|
561
310
|
});
|
|
562
311
|
}
|
|
563
312
|
get invalidateAll() {
|
|
564
|
-
return
|
|
565
|
-
this.cacheState.map =
|
|
313
|
+
return Effect.sync(() => {
|
|
314
|
+
this.cacheState.map = Effect.empty();
|
|
566
315
|
});
|
|
567
316
|
}
|
|
568
317
|
refresh(key) {
|
|
569
|
-
return
|
|
318
|
+
return Effect.clockWith(clock => Effect.suspend(() => {
|
|
570
319
|
const k = key;
|
|
571
|
-
const deferred = unsafeMake(this.fiberId);
|
|
572
|
-
let value =
|
|
320
|
+
const deferred = Effect.unsafeMake(this.fiberId);
|
|
321
|
+
let value = Effect.getOrUndefined(Effect.get(this.cacheState.map, k));
|
|
573
322
|
if (value === undefined) {
|
|
574
|
-
if (
|
|
575
|
-
value =
|
|
323
|
+
if (Effect.has(this.cacheState.map, k)) {
|
|
324
|
+
value = Effect.getOrUndefined(Effect.get(this.cacheState.map, k));
|
|
576
325
|
} else {
|
|
577
|
-
|
|
326
|
+
Effect.set(this.cacheState.map, k, pending(makeMapKey(k), deferred));
|
|
578
327
|
}
|
|
579
328
|
}
|
|
580
329
|
if (value === undefined) {
|
|
581
|
-
return
|
|
330
|
+
return Effect.asVoid(this.lookupValueOf(key, deferred));
|
|
582
331
|
} else {
|
|
583
332
|
switch (value._tag) {
|
|
584
333
|
case "Complete":
|
|
585
334
|
{
|
|
586
335
|
if (this.hasExpired(clock, value.timeToLiveMillis)) {
|
|
587
|
-
const found =
|
|
588
|
-
if (
|
|
589
|
-
|
|
336
|
+
const found = Effect.getOrUndefined(Effect.get(this.cacheState.map, k));
|
|
337
|
+
if (Effect.equals(found, value)) {
|
|
338
|
+
Effect.remove(this.cacheState.map, k);
|
|
590
339
|
}
|
|
591
|
-
return
|
|
340
|
+
return Effect.asVoid(this.get(key));
|
|
592
341
|
}
|
|
593
342
|
// Only trigger the lookup if we're still the current value, `completedResult`
|
|
594
|
-
return
|
|
595
|
-
const current =
|
|
596
|
-
if (
|
|
343
|
+
return Effect.pipe(this.lookupValueOf(key, deferred), Effect.when(() => {
|
|
344
|
+
const current = Effect.getOrUndefined(Effect.get(this.cacheState.map, k));
|
|
345
|
+
if (Effect.equals(current, value)) {
|
|
597
346
|
const mapValue = refreshing(deferred, value);
|
|
598
|
-
|
|
347
|
+
Effect.set(this.cacheState.map, k, mapValue);
|
|
599
348
|
return true;
|
|
600
349
|
}
|
|
601
350
|
return false;
|
|
602
|
-
}),
|
|
351
|
+
}), Effect.asVoid);
|
|
603
352
|
}
|
|
604
353
|
case "Pending":
|
|
605
354
|
{
|
|
606
|
-
return _await(value.deferred);
|
|
355
|
+
return Effect._await(value.deferred);
|
|
607
356
|
}
|
|
608
357
|
case "Refreshing":
|
|
609
358
|
{
|
|
610
|
-
return _await(value.deferred);
|
|
359
|
+
return Effect._await(value.deferred);
|
|
611
360
|
}
|
|
612
361
|
}
|
|
613
362
|
}
|
|
614
363
|
}));
|
|
615
364
|
}
|
|
616
365
|
set(key, value) {
|
|
617
|
-
return
|
|
366
|
+
return Effect.clockWith(clock => Effect.sync(() => {
|
|
618
367
|
const now = clock.unsafeCurrentTimeMillis();
|
|
619
368
|
const k = key;
|
|
620
|
-
const lookupResult = succeed(value);
|
|
621
|
-
const mapValue = complete(makeMapKey(k), lookupResult, makeEntryStats(now), now +
|
|
622
|
-
|
|
369
|
+
const lookupResult = Effect.succeed$2(value);
|
|
370
|
+
const mapValue = complete(makeMapKey(k), lookupResult, makeEntryStats(now), now + Effect.toMillis(Effect.decode(this.timeToLive(lookupResult))));
|
|
371
|
+
Effect.set(this.cacheState.map, k, mapValue);
|
|
623
372
|
}));
|
|
624
373
|
}
|
|
625
374
|
get size() {
|
|
626
|
-
return
|
|
627
|
-
return
|
|
375
|
+
return Effect.sync(() => {
|
|
376
|
+
return Effect.size(this.cacheState.map);
|
|
628
377
|
});
|
|
629
378
|
}
|
|
630
379
|
get values() {
|
|
631
|
-
return
|
|
380
|
+
return Effect.sync(() => {
|
|
632
381
|
const values = [];
|
|
633
382
|
for (const entry of this.cacheState.map) {
|
|
634
383
|
if (entry[1]._tag === "Complete" && entry[1].exit._tag === "Success") {
|
|
@@ -639,7 +388,7 @@ class CacheImpl {
|
|
|
639
388
|
});
|
|
640
389
|
}
|
|
641
390
|
get entries() {
|
|
642
|
-
return
|
|
391
|
+
return Effect.sync(() => {
|
|
643
392
|
const values = [];
|
|
644
393
|
for (const entry of this.cacheState.map) {
|
|
645
394
|
if (entry[1]._tag === "Complete" && entry[1].exit._tag === "Success") {
|
|
@@ -650,7 +399,7 @@ class CacheImpl {
|
|
|
650
399
|
});
|
|
651
400
|
}
|
|
652
401
|
get keys() {
|
|
653
|
-
return
|
|
402
|
+
return Effect.sync(() => {
|
|
654
403
|
const keys = [];
|
|
655
404
|
for (const entry of this.cacheState.map) {
|
|
656
405
|
if (entry[1]._tag === "Complete" && entry[1].exit._tag === "Success") {
|
|
@@ -661,26 +410,26 @@ class CacheImpl {
|
|
|
661
410
|
});
|
|
662
411
|
}
|
|
663
412
|
resolveMapValue(value, ignorePending = false) {
|
|
664
|
-
return
|
|
413
|
+
return Effect.clockWith(clock => {
|
|
665
414
|
switch (value._tag) {
|
|
666
415
|
case "Complete":
|
|
667
416
|
{
|
|
668
417
|
this.trackAccess(value.key);
|
|
669
418
|
if (this.hasExpired(clock, value.timeToLiveMillis)) {
|
|
670
|
-
|
|
671
|
-
return
|
|
419
|
+
Effect.remove(this.cacheState.map, value.key.current);
|
|
420
|
+
return Effect.succeed$1(Effect.none());
|
|
672
421
|
}
|
|
673
422
|
this.trackHit();
|
|
674
|
-
return
|
|
423
|
+
return Effect.map(value.exit, Effect.some);
|
|
675
424
|
}
|
|
676
425
|
case "Pending":
|
|
677
426
|
{
|
|
678
427
|
this.trackAccess(value.key);
|
|
679
428
|
this.trackHit();
|
|
680
429
|
if (ignorePending) {
|
|
681
|
-
return
|
|
430
|
+
return Effect.succeed$1(Effect.none());
|
|
682
431
|
}
|
|
683
|
-
return
|
|
432
|
+
return Effect.map(Effect._await(value.deferred), Effect.some);
|
|
684
433
|
}
|
|
685
434
|
case "Refreshing":
|
|
686
435
|
{
|
|
@@ -688,11 +437,11 @@ class CacheImpl {
|
|
|
688
437
|
this.trackHit();
|
|
689
438
|
if (this.hasExpired(clock, value.complete.timeToLiveMillis)) {
|
|
690
439
|
if (ignorePending) {
|
|
691
|
-
return
|
|
440
|
+
return Effect.succeed$1(Effect.none());
|
|
692
441
|
}
|
|
693
|
-
return
|
|
442
|
+
return Effect.map(Effect._await(value.deferred), Effect.some);
|
|
694
443
|
}
|
|
695
|
-
return
|
|
444
|
+
return Effect.map(value.complete.exit, Effect.some);
|
|
696
445
|
}
|
|
697
446
|
}
|
|
698
447
|
});
|
|
@@ -704,24 +453,24 @@ class CacheImpl {
|
|
|
704
453
|
this.cacheState.misses = this.cacheState.misses + 1;
|
|
705
454
|
}
|
|
706
455
|
trackAccess(key) {
|
|
707
|
-
offer(this.cacheState.accesses, key);
|
|
708
|
-
if (
|
|
456
|
+
Effect.offer(this.cacheState.accesses, key);
|
|
457
|
+
if (Effect.compareAndSet(this.cacheState.updating, false, true)) {
|
|
709
458
|
let loop = true;
|
|
710
459
|
while (loop) {
|
|
711
|
-
const key = poll(this.cacheState.accesses, EmptyMutableQueue);
|
|
712
|
-
if (key === EmptyMutableQueue) {
|
|
460
|
+
const key = Effect.poll(this.cacheState.accesses, Effect.EmptyMutableQueue);
|
|
461
|
+
if (key === Effect.EmptyMutableQueue) {
|
|
713
462
|
loop = false;
|
|
714
463
|
} else {
|
|
715
464
|
this.cacheState.keys.add(key);
|
|
716
465
|
}
|
|
717
466
|
}
|
|
718
|
-
let size =
|
|
467
|
+
let size = Effect.size(this.cacheState.map);
|
|
719
468
|
loop = size > this.capacity;
|
|
720
469
|
while (loop) {
|
|
721
470
|
const key = this.cacheState.keys.remove();
|
|
722
471
|
if (key !== undefined) {
|
|
723
|
-
if (
|
|
724
|
-
|
|
472
|
+
if (Effect.has(this.cacheState.map, key.current)) {
|
|
473
|
+
Effect.remove(this.cacheState.map, key.current);
|
|
725
474
|
size = size - 1;
|
|
726
475
|
loop = size > this.capacity;
|
|
727
476
|
}
|
|
@@ -729,30 +478,30 @@ class CacheImpl {
|
|
|
729
478
|
loop = false;
|
|
730
479
|
}
|
|
731
480
|
}
|
|
732
|
-
|
|
481
|
+
Effect.set$1(this.cacheState.updating, false);
|
|
733
482
|
}
|
|
734
483
|
}
|
|
735
484
|
hasExpired(clock, timeToLiveMillis) {
|
|
736
485
|
return clock.unsafeCurrentTimeMillis() > timeToLiveMillis;
|
|
737
486
|
}
|
|
738
487
|
lookupValueOf(input, deferred) {
|
|
739
|
-
return
|
|
488
|
+
return Effect.clockWith(clock => Effect.suspend(() => {
|
|
740
489
|
const key = input;
|
|
741
|
-
return
|
|
490
|
+
return Effect.pipe(this.lookup(input), Effect.provideContext(this.context), Effect.exit, Effect.flatMap(exit => {
|
|
742
491
|
const now = clock.unsafeCurrentTimeMillis();
|
|
743
492
|
const stats = makeEntryStats(now);
|
|
744
|
-
const value = complete(makeMapKey(key), exit, stats, now +
|
|
745
|
-
|
|
746
|
-
return
|
|
747
|
-
}),
|
|
748
|
-
|
|
493
|
+
const value = complete(makeMapKey(key), exit, stats, now + Effect.toMillis(Effect.decode(this.timeToLive(exit))));
|
|
494
|
+
Effect.set(this.cacheState.map, key, value);
|
|
495
|
+
return Effect.zipRight(Effect.done(deferred, exit), exit);
|
|
496
|
+
}), Effect.onInterrupt(() => Effect.zipRight(Effect.interrupt(deferred), Effect.sync(() => {
|
|
497
|
+
Effect.remove(this.cacheState.map, key);
|
|
749
498
|
}))));
|
|
750
499
|
}));
|
|
751
500
|
}
|
|
752
501
|
}
|
|
753
502
|
/** @internal */
|
|
754
503
|
const make$1 = options => {
|
|
755
|
-
const timeToLive =
|
|
504
|
+
const timeToLive = Effect.decode(options.timeToLive);
|
|
756
505
|
return makeWith({
|
|
757
506
|
capacity: options.capacity,
|
|
758
507
|
lookup: options.lookup,
|
|
@@ -760,7 +509,7 @@ const make$1 = options => {
|
|
|
760
509
|
});
|
|
761
510
|
};
|
|
762
511
|
/** @internal */
|
|
763
|
-
const makeWith = options =>
|
|
512
|
+
const makeWith = options => Effect.map(Effect.all([Effect.context(), Effect.fiberId]), ([context, fiberId]) => new CacheImpl(options.capacity, context, fiberId, options.lookup, exit => Effect.decode(options.timeToLive(exit))));
|
|
764
513
|
|
|
765
514
|
/**
|
|
766
515
|
* Constructs a new cache with the specified capacity, time to live, and
|
|
@@ -771,37 +520,84 @@ const makeWith = options => assets.map(assets.all([assets.context(), assets.fibe
|
|
|
771
520
|
*/
|
|
772
521
|
const make = make$1;
|
|
773
522
|
|
|
774
|
-
|
|
523
|
+
/**
|
|
524
|
+
* Provides a constructor for a Case Class.
|
|
525
|
+
*
|
|
526
|
+
* @since 2.0.0
|
|
527
|
+
* @category constructors
|
|
528
|
+
*/
|
|
529
|
+
const Error$1 = /*#__PURE__*/function () {
|
|
530
|
+
const plainArgsSymbol = /*#__PURE__*/Symbol.for("effect/Data/Error/plainArgs");
|
|
531
|
+
const O = {
|
|
532
|
+
BaseEffectError: class extends Effect.YieldableError {
|
|
533
|
+
constructor(args) {
|
|
534
|
+
super(args?.message, args?.cause ? {
|
|
535
|
+
cause: args.cause
|
|
536
|
+
} : undefined);
|
|
537
|
+
if (args) {
|
|
538
|
+
Object.assign(this, args);
|
|
539
|
+
// @effect-diagnostics-next-line floatingEffect:off
|
|
540
|
+
Object.defineProperty(this, plainArgsSymbol, {
|
|
541
|
+
value: args,
|
|
542
|
+
enumerable: false
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
toJSON() {
|
|
547
|
+
return {
|
|
548
|
+
...this[plainArgsSymbol],
|
|
549
|
+
...this
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
return O.BaseEffectError;
|
|
555
|
+
}();
|
|
556
|
+
/**
|
|
557
|
+
* @since 2.0.0
|
|
558
|
+
* @category constructors
|
|
559
|
+
*/
|
|
560
|
+
const TaggedError = tag => {
|
|
561
|
+
const O = {
|
|
562
|
+
BaseEffectError: class extends Error$1 {
|
|
563
|
+
_tag = tag;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
O.BaseEffectError.prototype.name = tag;
|
|
567
|
+
return O.BaseEffectError;
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
class FetchError extends TaggedError('FetchError') {
|
|
775
571
|
}
|
|
776
|
-
class NotFoundError extends
|
|
572
|
+
class NotFoundError extends TaggedError('NotFoundError') {
|
|
777
573
|
}
|
|
778
|
-
const httpClient = (input, init) =>
|
|
779
|
-
const response = yield*
|
|
574
|
+
const httpClient = (input, init) => Effect.gen(function* () {
|
|
575
|
+
const response = yield* Effect.tryPromise({
|
|
780
576
|
try: () => fetch(input, init),
|
|
781
577
|
catch: error => new FetchError({ cause: error }),
|
|
782
578
|
});
|
|
783
579
|
if (response.status === 404) {
|
|
784
|
-
return yield* new NotFoundError({ url: response.url });
|
|
580
|
+
return yield* Effect.fail(new NotFoundError({ url: response.url }));
|
|
785
581
|
}
|
|
786
582
|
return response;
|
|
787
583
|
});
|
|
788
|
-
class ResponseTextError extends
|
|
584
|
+
class ResponseTextError extends TaggedError('ResponseTextError') {
|
|
789
585
|
constructor(error) {
|
|
790
586
|
super(new Error(`Failed to read response text`, { cause: error }));
|
|
791
587
|
}
|
|
792
588
|
}
|
|
793
|
-
const responseAsText = (res) =>
|
|
589
|
+
const responseAsText = (res) => Effect.tryPromise({
|
|
794
590
|
try: () => res.text(),
|
|
795
591
|
catch: error => new ResponseTextError(error),
|
|
796
592
|
});
|
|
797
593
|
|
|
798
594
|
const SVGString = refined(isValidSVG, () => error('SVG data is malformed'));
|
|
799
|
-
class BrandValidationError extends
|
|
595
|
+
class BrandValidationError extends TaggedError('BrandValidationError') {
|
|
800
596
|
constructor(error, type) {
|
|
801
597
|
super(new Error(`Brand validation failed for type ${type}.`, { cause: error }));
|
|
802
598
|
}
|
|
803
599
|
}
|
|
804
|
-
const createValidSVGString = (svg) =>
|
|
600
|
+
const createValidSVGString = (svg) => Effect.try_({
|
|
805
601
|
try: () => SVGString(svg),
|
|
806
602
|
catch: error => new BrandValidationError(error, 'SVGString'),
|
|
807
603
|
});
|
|
@@ -822,10 +618,10 @@ function isValidSVG(svg) {
|
|
|
822
618
|
const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
823
619
|
const createIconCache = () => make({
|
|
824
620
|
capacity: 200,
|
|
825
|
-
timeToLive:
|
|
826
|
-
lookup: (key) =>
|
|
621
|
+
timeToLive: Effect.infinity,
|
|
622
|
+
lookup: (key) => Effect.gen$1(function* () {
|
|
827
623
|
const name = key;
|
|
828
|
-
const assetPath =
|
|
624
|
+
const assetPath = assets.createAssetUrlSafely(`${name}.svg`, 'icons');
|
|
829
625
|
const res = yield* httpClient(assetPath);
|
|
830
626
|
const responseString = yield* responseAsText(res);
|
|
831
627
|
return yield* createValidSVGString(responseString);
|
|
@@ -834,7 +630,7 @@ const createIconCache = () => make({
|
|
|
834
630
|
let cacheInstance = null;
|
|
835
631
|
function fetchIconSvg(name) {
|
|
836
632
|
const key = name;
|
|
837
|
-
return
|
|
633
|
+
return Effect.gen$1(function* () {
|
|
838
634
|
if (!cacheInstance) {
|
|
839
635
|
cacheInstance = yield* createIconCache();
|
|
840
636
|
}
|
|
@@ -842,12 +638,12 @@ function fetchIconSvg(name) {
|
|
|
842
638
|
});
|
|
843
639
|
}
|
|
844
640
|
function clearIconCache() {
|
|
845
|
-
return
|
|
641
|
+
return Effect.gen$1(function* () {
|
|
846
642
|
if (cacheInstance) {
|
|
847
643
|
yield* cacheInstance.invalidateAll;
|
|
848
644
|
}
|
|
849
645
|
else {
|
|
850
|
-
|
|
646
|
+
Effect.logWarning('Attempted to clear icon cache before it was initialized');
|
|
851
647
|
}
|
|
852
648
|
});
|
|
853
649
|
}
|