solid-ctrl-flow 1.0.55 → 1.0.56
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/index.d.ts +0 -8
- package/dist/index.mjs +1 -16
- package/dist/index.umd.js +0 -15
- package/package.json +1 -1
- package/readMe.md +0 -3
package/dist/index.d.ts
CHANGED
|
@@ -60,14 +60,6 @@ export declare function Case<T>(props: {
|
|
|
60
60
|
children(x: NonNullable<T>): JSX.Element;
|
|
61
61
|
}): JSX.Element;
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Returns a {@link Signal} that applies the `??=` operator to the input one.
|
|
65
|
-
* If the getter of {@link param0} is like `x`, then the result one is like "(x ??= {@link f}())"
|
|
66
|
-
* @param param0 The {@link Signal} to which to coalesce the getter
|
|
67
|
-
* @param f An {@link Accessor} to the value to use when there's a nullish value
|
|
68
|
-
*/
|
|
69
|
-
export declare function coalesceSignal<T>([get, set]: Signal<T | undefined>, f: Accessor<T>): Signal<T>;
|
|
70
|
-
|
|
71
63
|
/** Conversion function for bindings */
|
|
72
64
|
export declare type Convert<S, D> = (x: S, prev: D) => D;
|
|
73
65
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext, createMemo, createComponent, createContext, createRoot, getOwner, untrack, createEffect, on, createResource, splitProps, Show, onCleanup, For, Match, mergeProps, createComputed, createSignal
|
|
1
|
+
import { useContext, createMemo, createComponent, createContext, createRoot, getOwner, untrack, createEffect, on, createResource, splitProps, Show, onCleanup, For, Match, mergeProps, createComputed, createSignal } from "solid-js";
|
|
2
2
|
import { createMutable } from "solid-js/store";
|
|
3
3
|
const BASE_CTOR = Function;
|
|
4
4
|
class ReactiveContext extends BASE_CTOR {
|
|
@@ -264,20 +264,6 @@ function forceSignal([get, set]) {
|
|
|
264
264
|
}
|
|
265
265
|
];
|
|
266
266
|
}
|
|
267
|
-
function coalesceSignal([get, set], f) {
|
|
268
|
-
return [getter, set];
|
|
269
|
-
function getter() {
|
|
270
|
-
const out = get();
|
|
271
|
-
if (out != null)
|
|
272
|
-
return out;
|
|
273
|
-
const listener = getListener(), { state } = listener;
|
|
274
|
-
try {
|
|
275
|
-
return set(f);
|
|
276
|
-
} finally {
|
|
277
|
-
listener.state = state;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
267
|
const debug = ReactiveContext.create(false, "debug-scope");
|
|
282
268
|
function SameContext(props) {
|
|
283
269
|
return createMemo(() => {
|
|
@@ -294,7 +280,6 @@ export {
|
|
|
294
280
|
Slot,
|
|
295
281
|
bind,
|
|
296
282
|
bindTwoWay,
|
|
297
|
-
coalesceSignal,
|
|
298
283
|
createExtractor,
|
|
299
284
|
createReactiveResource,
|
|
300
285
|
debug,
|
package/dist/index.umd.js
CHANGED
|
@@ -266,20 +266,6 @@
|
|
|
266
266
|
}
|
|
267
267
|
];
|
|
268
268
|
}
|
|
269
|
-
function coalesceSignal([get, set], f) {
|
|
270
|
-
return [getter, set];
|
|
271
|
-
function getter() {
|
|
272
|
-
const out = get();
|
|
273
|
-
if (out != null)
|
|
274
|
-
return out;
|
|
275
|
-
const listener = solidJs.getListener(), { state } = listener;
|
|
276
|
-
try {
|
|
277
|
-
return set(f);
|
|
278
|
-
} finally {
|
|
279
|
-
listener.state = state;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
269
|
const debug = ReactiveContext.create(false, "debug-scope");
|
|
284
270
|
function SameContext(props) {
|
|
285
271
|
return solidJs.createMemo(() => {
|
|
@@ -294,7 +280,6 @@
|
|
|
294
280
|
exports2.SameContext = SameContext;
|
|
295
281
|
exports2.bind = bind;
|
|
296
282
|
exports2.bindTwoWay = bindTwoWay;
|
|
297
|
-
exports2.coalesceSignal = coalesceSignal;
|
|
298
283
|
exports2.createExtractor = createExtractor;
|
|
299
284
|
exports2.createReactiveResource = createReactiveResource;
|
|
300
285
|
exports2.debug = debug;
|
package/package.json
CHANGED
package/readMe.md
CHANGED
|
@@ -182,9 +182,6 @@ Functions that create bindings between `Signal`s
|
|
|
182
182
|
>
|
|
183
183
|
> #### `forceSignal()`
|
|
184
184
|
> Creates a `Signal` that behaves like the input one, with the only difference that each call to the setter will trigger the effects even if the value didn't change
|
|
185
|
-
>
|
|
186
|
-
> #### `coalesceSignal()`
|
|
187
|
-
> Creates a non nullable `Signal` from a nullable one
|
|
188
185
|
|
|
189
186
|
### `ReactiveContext.create()`
|
|
190
187
|
Method that creates a reactive version of a solid `Context` with some additional built-in functionalities
|