solid-js 2.0.0-experimental.0 → 2.0.0-experimental.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/LICENSE +1 -1
- package/dist/dev.cjs +44 -38
- package/dist/dev.js +45 -39
- package/dist/solid.cjs +38 -36
- package/dist/solid.js +43 -37
- package/package.json +2 -2
- package/types/client/observable.d.ts +11 -11
- package/types/index.d.ts +2 -2
package/LICENSE
CHANGED
package/dist/dev.cjs
CHANGED
|
@@ -83,8 +83,8 @@ function observable(input) {
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function from(producer) {
|
|
87
|
-
const [s, set] = signals.createSignal(
|
|
86
|
+
function from(producer, initialValue = undefined) {
|
|
87
|
+
const [s, set] = signals.createSignal(() => initialValue, initialValue, {
|
|
88
88
|
equals: false
|
|
89
89
|
});
|
|
90
90
|
if ("subscribe" in producer) {
|
|
@@ -204,8 +204,11 @@ function Repeat(props) {
|
|
|
204
204
|
}
|
|
205
205
|
function Show(props) {
|
|
206
206
|
const keyed = props.keyed;
|
|
207
|
-
const
|
|
208
|
-
|
|
207
|
+
const conditionValue = signals.createMemo(() => props.when, undefined, {
|
|
208
|
+
name: "condition value"
|
|
209
|
+
} );
|
|
210
|
+
const condition = keyed ? conditionValue : signals.createMemo(conditionValue, undefined, {
|
|
211
|
+
equals: (a, b) => !a === !b,
|
|
209
212
|
name: "condition"
|
|
210
213
|
} );
|
|
211
214
|
return signals.createMemo(() => {
|
|
@@ -215,7 +218,7 @@ function Show(props) {
|
|
|
215
218
|
const fn = typeof child === "function" && child.length > 0;
|
|
216
219
|
return fn ? signals.untrack(() => child(() => {
|
|
217
220
|
if (!signals.untrack(condition)) throw narrowedError("Show");
|
|
218
|
-
return
|
|
221
|
+
return conditionValue();
|
|
219
222
|
})) : child;
|
|
220
223
|
}
|
|
221
224
|
return props.fallback;
|
|
@@ -224,35 +227,38 @@ function Show(props) {
|
|
|
224
227
|
} );
|
|
225
228
|
}
|
|
226
229
|
function Switch(props) {
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
230
|
+
const chs = children(() => props.children);
|
|
231
|
+
const switchFunc = signals.createMemo(() => {
|
|
232
|
+
const ch = chs();
|
|
233
|
+
const mps = Array.isArray(ch) ? ch : [ch];
|
|
234
|
+
let func = () => undefined;
|
|
235
|
+
for (let i = 0; i < mps.length; i++) {
|
|
236
|
+
const index = i;
|
|
237
|
+
const mp = mps[i];
|
|
238
|
+
const prevFunc = func;
|
|
239
|
+
const conditionValue = signals.createMemo(() => prevFunc() ? undefined : mp.when, undefined, {
|
|
240
|
+
name: "condition value"
|
|
241
|
+
} );
|
|
242
|
+
const condition = mp.keyed ? conditionValue : signals.createMemo(conditionValue, undefined, {
|
|
243
|
+
equals: (a, b) => !a === !b,
|
|
244
|
+
name: "condition"
|
|
245
|
+
} );
|
|
246
|
+
func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
|
|
247
|
+
}
|
|
248
|
+
return func;
|
|
249
|
+
});
|
|
245
250
|
return signals.createMemo(() => {
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
const sel = switchFunc()();
|
|
252
|
+
if (!sel) return props.fallback;
|
|
253
|
+
const [index, conditionValue, mp] = sel;
|
|
254
|
+
const child = mp.children;
|
|
255
|
+
const fn = typeof child === "function" && child.length > 0;
|
|
256
|
+
return fn ? signals.untrack(() => child(() => {
|
|
257
|
+
if (signals.untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
|
|
258
|
+
return conditionValue();
|
|
259
|
+
})) : child;
|
|
254
260
|
}, undefined, {
|
|
255
|
-
name: "
|
|
261
|
+
name: "eval conditions"
|
|
256
262
|
} );
|
|
257
263
|
}
|
|
258
264
|
function Match(props) {
|
|
@@ -310,10 +316,6 @@ Object.defineProperty(exports, "createProjection", {
|
|
|
310
316
|
enumerable: true,
|
|
311
317
|
get: function () { return signals.createProjection; }
|
|
312
318
|
});
|
|
313
|
-
Object.defineProperty(exports, "createReaction", {
|
|
314
|
-
enumerable: true,
|
|
315
|
-
get: function () { return signals.createReaction; }
|
|
316
|
-
});
|
|
317
319
|
Object.defineProperty(exports, "createRenderEffect", {
|
|
318
320
|
enumerable: true,
|
|
319
321
|
get: function () { return signals.createRenderEffect; }
|
|
@@ -350,9 +352,9 @@ Object.defineProperty(exports, "isEqual", {
|
|
|
350
352
|
enumerable: true,
|
|
351
353
|
get: function () { return signals.isEqual; }
|
|
352
354
|
});
|
|
353
|
-
Object.defineProperty(exports, "
|
|
355
|
+
Object.defineProperty(exports, "isPending", {
|
|
354
356
|
enumerable: true,
|
|
355
|
-
get: function () { return signals.
|
|
357
|
+
get: function () { return signals.isPending; }
|
|
356
358
|
});
|
|
357
359
|
Object.defineProperty(exports, "isWrappable", {
|
|
358
360
|
enumerable: true,
|
|
@@ -390,6 +392,10 @@ Object.defineProperty(exports, "resolve", {
|
|
|
390
392
|
enumerable: true,
|
|
391
393
|
get: function () { return signals.resolve; }
|
|
392
394
|
});
|
|
395
|
+
Object.defineProperty(exports, "runWithObserver", {
|
|
396
|
+
enumerable: true,
|
|
397
|
+
get: function () { return signals.runWithObserver; }
|
|
398
|
+
});
|
|
393
399
|
Object.defineProperty(exports, "runWithOwner", {
|
|
394
400
|
enumerable: true,
|
|
395
401
|
get: function () { return signals.runWithOwner; }
|
package/dist/dev.js
CHANGED
|
@@ -24,7 +24,6 @@ export {
|
|
|
24
24
|
createEffect,
|
|
25
25
|
createMemo,
|
|
26
26
|
createProjection,
|
|
27
|
-
createReaction,
|
|
28
27
|
createRenderEffect,
|
|
29
28
|
createRoot,
|
|
30
29
|
createSignal,
|
|
@@ -34,7 +33,7 @@ export {
|
|
|
34
33
|
getObserver,
|
|
35
34
|
getOwner,
|
|
36
35
|
isEqual,
|
|
37
|
-
|
|
36
|
+
isPending,
|
|
38
37
|
isWrappable,
|
|
39
38
|
latest,
|
|
40
39
|
mapArray,
|
|
@@ -44,6 +43,7 @@ export {
|
|
|
44
43
|
reconcile,
|
|
45
44
|
repeat,
|
|
46
45
|
resolve,
|
|
46
|
+
runWithObserver,
|
|
47
47
|
runWithOwner,
|
|
48
48
|
untrack,
|
|
49
49
|
unwrap
|
|
@@ -138,8 +138,8 @@ function observable(input) {
|
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
function from(producer) {
|
|
142
|
-
const [s, set] = createSignal(
|
|
141
|
+
function from(producer, initialValue = undefined) {
|
|
142
|
+
const [s, set] = createSignal(() => initialValue, initialValue, {
|
|
143
143
|
equals: false
|
|
144
144
|
});
|
|
145
145
|
if ("subscribe" in producer) {
|
|
@@ -282,10 +282,15 @@ function Repeat(props) {
|
|
|
282
282
|
}
|
|
283
283
|
function Show(props) {
|
|
284
284
|
const keyed = props.keyed;
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
name: "condition"
|
|
285
|
+
const conditionValue = createMemo(() => props.when, undefined, {
|
|
286
|
+
name: "condition value"
|
|
288
287
|
});
|
|
288
|
+
const condition = keyed
|
|
289
|
+
? conditionValue
|
|
290
|
+
: createMemo(conditionValue, undefined, {
|
|
291
|
+
equals: (a, b) => !a === !b,
|
|
292
|
+
name: "condition"
|
|
293
|
+
});
|
|
289
294
|
return createMemo(
|
|
290
295
|
() => {
|
|
291
296
|
const c = condition();
|
|
@@ -296,7 +301,7 @@ function Show(props) {
|
|
|
296
301
|
? untrack(() =>
|
|
297
302
|
child(() => {
|
|
298
303
|
if (!untrack(condition)) throw narrowedError("Show");
|
|
299
|
-
return
|
|
304
|
+
return conditionValue();
|
|
300
305
|
})
|
|
301
306
|
)
|
|
302
307
|
: child;
|
|
@@ -310,46 +315,47 @@ function Show(props) {
|
|
|
310
315
|
);
|
|
311
316
|
}
|
|
312
317
|
function Switch(props) {
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
318
|
+
const chs = children(() => props.children);
|
|
319
|
+
const switchFunc = createMemo(() => {
|
|
320
|
+
const ch = chs();
|
|
321
|
+
const mps = Array.isArray(ch) ? ch : [ch];
|
|
322
|
+
let func = () => undefined;
|
|
323
|
+
for (let i = 0; i < mps.length; i++) {
|
|
324
|
+
const index = i;
|
|
325
|
+
const mp = mps[i];
|
|
326
|
+
const prevFunc = func;
|
|
327
|
+
const conditionValue = createMemo(() => (prevFunc() ? undefined : mp.when), undefined, {
|
|
328
|
+
name: "condition value"
|
|
329
|
+
});
|
|
330
|
+
const condition = mp.keyed
|
|
331
|
+
? conditionValue
|
|
332
|
+
: createMemo(conditionValue, undefined, {
|
|
333
|
+
equals: (a, b) => !a === !b,
|
|
334
|
+
name: "condition"
|
|
335
|
+
});
|
|
336
|
+
func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
|
|
337
|
+
}
|
|
338
|
+
return func;
|
|
339
|
+
});
|
|
335
340
|
return createMemo(
|
|
336
341
|
() => {
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
339
|
-
const
|
|
340
|
-
const
|
|
342
|
+
const sel = switchFunc()();
|
|
343
|
+
if (!sel) return props.fallback;
|
|
344
|
+
const [index, conditionValue, mp] = sel;
|
|
345
|
+
const child = mp.children;
|
|
346
|
+
const fn = typeof child === "function" && child.length > 0;
|
|
341
347
|
return fn
|
|
342
348
|
? untrack(() =>
|
|
343
|
-
|
|
344
|
-
if (untrack(
|
|
345
|
-
return
|
|
349
|
+
child(() => {
|
|
350
|
+
if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
|
|
351
|
+
return conditionValue();
|
|
346
352
|
})
|
|
347
353
|
)
|
|
348
|
-
:
|
|
354
|
+
: child;
|
|
349
355
|
},
|
|
350
356
|
undefined,
|
|
351
357
|
{
|
|
352
|
-
name: "
|
|
358
|
+
name: "eval conditions"
|
|
353
359
|
}
|
|
354
360
|
);
|
|
355
361
|
}
|
package/dist/solid.cjs
CHANGED
|
@@ -61,8 +61,8 @@ function observable(input) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function from(producer) {
|
|
65
|
-
const [s, set] = signals.createSignal(
|
|
64
|
+
function from(producer, initialValue = undefined) {
|
|
65
|
+
const [s, set] = signals.createSignal(() => initialValue, initialValue, {
|
|
66
66
|
equals: false
|
|
67
67
|
});
|
|
68
68
|
if ("subscribe" in producer) {
|
|
@@ -175,8 +175,9 @@ function Repeat(props) {
|
|
|
175
175
|
}
|
|
176
176
|
function Show(props) {
|
|
177
177
|
const keyed = props.keyed;
|
|
178
|
-
const
|
|
179
|
-
|
|
178
|
+
const conditionValue = signals.createMemo(() => props.when, undefined, undefined);
|
|
179
|
+
const condition = keyed ? conditionValue : signals.createMemo(conditionValue, undefined, {
|
|
180
|
+
equals: (a, b) => !a === !b
|
|
180
181
|
});
|
|
181
182
|
return signals.createMemo(() => {
|
|
182
183
|
const c = condition();
|
|
@@ -185,39 +186,40 @@ function Show(props) {
|
|
|
185
186
|
const fn = typeof child === "function" && child.length > 0;
|
|
186
187
|
return fn ? signals.untrack(() => child(() => {
|
|
187
188
|
if (!signals.untrack(condition)) throw narrowedError("Show");
|
|
188
|
-
return
|
|
189
|
+
return conditionValue();
|
|
189
190
|
})) : child;
|
|
190
191
|
}
|
|
191
192
|
return props.fallback;
|
|
192
193
|
}, undefined, undefined);
|
|
193
194
|
}
|
|
194
195
|
function Switch(props) {
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
196
|
+
const chs = children(() => props.children);
|
|
197
|
+
const switchFunc = signals.createMemo(() => {
|
|
198
|
+
const ch = chs();
|
|
199
|
+
const mps = Array.isArray(ch) ? ch : [ch];
|
|
200
|
+
let func = () => undefined;
|
|
201
|
+
for (let i = 0; i < mps.length; i++) {
|
|
202
|
+
const index = i;
|
|
203
|
+
const mp = mps[i];
|
|
204
|
+
const prevFunc = func;
|
|
205
|
+
const conditionValue = signals.createMemo(() => prevFunc() ? undefined : mp.when, undefined, undefined);
|
|
206
|
+
const condition = mp.keyed ? conditionValue : signals.createMemo(conditionValue, undefined, {
|
|
207
|
+
equals: (a, b) => !a === !b
|
|
208
|
+
});
|
|
209
|
+
func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
|
|
210
|
+
}
|
|
211
|
+
return func;
|
|
212
|
+
});
|
|
212
213
|
return signals.createMemo(() => {
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
214
|
+
const sel = switchFunc()();
|
|
215
|
+
if (!sel) return props.fallback;
|
|
216
|
+
const [index, conditionValue, mp] = sel;
|
|
217
|
+
const child = mp.children;
|
|
218
|
+
const fn = typeof child === "function" && child.length > 0;
|
|
219
|
+
return fn ? signals.untrack(() => child(() => {
|
|
220
|
+
if (signals.untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
|
|
221
|
+
return conditionValue();
|
|
222
|
+
})) : child;
|
|
221
223
|
}, undefined, undefined);
|
|
222
224
|
}
|
|
223
225
|
function Match(props) {
|
|
@@ -267,10 +269,6 @@ Object.defineProperty(exports, "createProjection", {
|
|
|
267
269
|
enumerable: true,
|
|
268
270
|
get: function () { return signals.createProjection; }
|
|
269
271
|
});
|
|
270
|
-
Object.defineProperty(exports, "createReaction", {
|
|
271
|
-
enumerable: true,
|
|
272
|
-
get: function () { return signals.createReaction; }
|
|
273
|
-
});
|
|
274
272
|
Object.defineProperty(exports, "createRenderEffect", {
|
|
275
273
|
enumerable: true,
|
|
276
274
|
get: function () { return signals.createRenderEffect; }
|
|
@@ -307,9 +305,9 @@ Object.defineProperty(exports, "isEqual", {
|
|
|
307
305
|
enumerable: true,
|
|
308
306
|
get: function () { return signals.isEqual; }
|
|
309
307
|
});
|
|
310
|
-
Object.defineProperty(exports, "
|
|
308
|
+
Object.defineProperty(exports, "isPending", {
|
|
311
309
|
enumerable: true,
|
|
312
|
-
get: function () { return signals.
|
|
310
|
+
get: function () { return signals.isPending; }
|
|
313
311
|
});
|
|
314
312
|
Object.defineProperty(exports, "isWrappable", {
|
|
315
313
|
enumerable: true,
|
|
@@ -347,6 +345,10 @@ Object.defineProperty(exports, "resolve", {
|
|
|
347
345
|
enumerable: true,
|
|
348
346
|
get: function () { return signals.resolve; }
|
|
349
347
|
});
|
|
348
|
+
Object.defineProperty(exports, "runWithObserver", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function () { return signals.runWithObserver; }
|
|
351
|
+
});
|
|
350
352
|
Object.defineProperty(exports, "runWithOwner", {
|
|
351
353
|
enumerable: true,
|
|
352
354
|
get: function () { return signals.runWithOwner; }
|
package/dist/solid.js
CHANGED
|
@@ -24,7 +24,6 @@ export {
|
|
|
24
24
|
createEffect,
|
|
25
25
|
createMemo,
|
|
26
26
|
createProjection,
|
|
27
|
-
createReaction,
|
|
28
27
|
createRenderEffect,
|
|
29
28
|
createRoot,
|
|
30
29
|
createSignal,
|
|
@@ -34,7 +33,7 @@ export {
|
|
|
34
33
|
getObserver,
|
|
35
34
|
getOwner,
|
|
36
35
|
isEqual,
|
|
37
|
-
|
|
36
|
+
isPending,
|
|
38
37
|
isWrappable,
|
|
39
38
|
latest,
|
|
40
39
|
mapArray,
|
|
@@ -44,6 +43,7 @@ export {
|
|
|
44
43
|
reconcile,
|
|
45
44
|
repeat,
|
|
46
45
|
resolve,
|
|
46
|
+
runWithObserver,
|
|
47
47
|
runWithOwner,
|
|
48
48
|
untrack,
|
|
49
49
|
unwrap
|
|
@@ -115,8 +115,8 @@ function observable(input) {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function from(producer) {
|
|
119
|
-
const [s, set] = createSignal(
|
|
118
|
+
function from(producer, initialValue = undefined) {
|
|
119
|
+
const [s, set] = createSignal(() => initialValue, initialValue, {
|
|
120
120
|
equals: false
|
|
121
121
|
});
|
|
122
122
|
if ("subscribe" in producer) {
|
|
@@ -245,9 +245,12 @@ function Repeat(props) {
|
|
|
245
245
|
}
|
|
246
246
|
function Show(props) {
|
|
247
247
|
const keyed = props.keyed;
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
const conditionValue = createMemo(() => props.when, undefined, undefined);
|
|
249
|
+
const condition = keyed
|
|
250
|
+
? conditionValue
|
|
251
|
+
: createMemo(conditionValue, undefined, {
|
|
252
|
+
equals: (a, b) => !a === !b
|
|
253
|
+
});
|
|
251
254
|
return createMemo(
|
|
252
255
|
() => {
|
|
253
256
|
const c = condition();
|
|
@@ -258,7 +261,7 @@ function Show(props) {
|
|
|
258
261
|
? untrack(() =>
|
|
259
262
|
child(() => {
|
|
260
263
|
if (!untrack(condition)) throw narrowedError("Show");
|
|
261
|
-
return
|
|
264
|
+
return conditionValue();
|
|
262
265
|
})
|
|
263
266
|
)
|
|
264
267
|
: child;
|
|
@@ -270,41 +273,44 @@ function Show(props) {
|
|
|
270
273
|
);
|
|
271
274
|
}
|
|
272
275
|
function Switch(props) {
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
276
|
+
const chs = children(() => props.children);
|
|
277
|
+
const switchFunc = createMemo(() => {
|
|
278
|
+
const ch = chs();
|
|
279
|
+
const mps = Array.isArray(ch) ? ch : [ch];
|
|
280
|
+
let func = () => undefined;
|
|
281
|
+
for (let i = 0; i < mps.length; i++) {
|
|
282
|
+
const index = i;
|
|
283
|
+
const mp = mps[i];
|
|
284
|
+
const prevFunc = func;
|
|
285
|
+
const conditionValue = createMemo(
|
|
286
|
+
() => (prevFunc() ? undefined : mp.when),
|
|
287
|
+
undefined,
|
|
288
|
+
undefined
|
|
289
|
+
);
|
|
290
|
+
const condition = mp.keyed
|
|
291
|
+
? conditionValue
|
|
292
|
+
: createMemo(conditionValue, undefined, {
|
|
293
|
+
equals: (a, b) => !a === !b
|
|
294
|
+
});
|
|
295
|
+
func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
|
|
296
|
+
}
|
|
297
|
+
return func;
|
|
298
|
+
});
|
|
294
299
|
return createMemo(
|
|
295
300
|
() => {
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
const
|
|
301
|
+
const sel = switchFunc()();
|
|
302
|
+
if (!sel) return props.fallback;
|
|
303
|
+
const [index, conditionValue, mp] = sel;
|
|
304
|
+
const child = mp.children;
|
|
305
|
+
const fn = typeof child === "function" && child.length > 0;
|
|
300
306
|
return fn
|
|
301
307
|
? untrack(() =>
|
|
302
|
-
|
|
303
|
-
if (untrack(
|
|
304
|
-
return
|
|
308
|
+
child(() => {
|
|
309
|
+
if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
|
|
310
|
+
return conditionValue();
|
|
305
311
|
})
|
|
306
312
|
)
|
|
307
|
-
:
|
|
313
|
+
: child;
|
|
308
314
|
},
|
|
309
315
|
undefined,
|
|
310
316
|
undefined
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-js",
|
|
3
3
|
"description": "A declarative JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "2.0.0-experimental.
|
|
4
|
+
"version": "2.0.0-experimental.2",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"performance"
|
|
80
80
|
],
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@solidjs/signals": "^0.
|
|
82
|
+
"@solidjs/signals": "^0.2.1",
|
|
83
83
|
"csstype": "^3.1.0"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
@@ -28,15 +28,15 @@ export type ObservableObserver<T> =
|
|
|
28
28
|
* description https://docs.solidjs.com/reference/reactive-utilities/observable
|
|
29
29
|
*/
|
|
30
30
|
export declare function observable<T>(input: Accessor<T>): Observable<T>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
): Accessor<T | undefined>;
|
|
31
|
+
type Producer<T> =
|
|
32
|
+
| ((setter: Setter<T>) => () => void)
|
|
33
|
+
| {
|
|
34
|
+
subscribe: (fn: (v: T) => void) =>
|
|
35
|
+
| (() => void)
|
|
36
|
+
| {
|
|
37
|
+
unsubscribe: () => void;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare function from<T>(producer: Producer<T>, initalValue: T): Accessor<T>;
|
|
41
|
+
export declare function from<T>(producer: Producer<T | undefined>): Accessor<T | undefined>;
|
|
42
42
|
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export {
|
|
|
7
7
|
createEffect,
|
|
8
8
|
createMemo,
|
|
9
9
|
createProjection,
|
|
10
|
-
createReaction,
|
|
11
10
|
createRenderEffect,
|
|
12
11
|
createRoot,
|
|
13
12
|
createSignal,
|
|
@@ -17,7 +16,7 @@ export {
|
|
|
17
16
|
getObserver,
|
|
18
17
|
getOwner,
|
|
19
18
|
isEqual,
|
|
20
|
-
|
|
19
|
+
isPending,
|
|
21
20
|
isWrappable,
|
|
22
21
|
latest,
|
|
23
22
|
mapArray,
|
|
@@ -27,6 +26,7 @@ export {
|
|
|
27
26
|
reconcile,
|
|
28
27
|
repeat,
|
|
29
28
|
resolve,
|
|
29
|
+
runWithObserver,
|
|
30
30
|
runWithOwner,
|
|
31
31
|
untrack,
|
|
32
32
|
unwrap
|