solid-ctrl-flow 2.2.3 → 2.2.4
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 +9 -8
- package/dist/index.mjs +3 -2
- package/dist/index.umd.js +3 -2
- package/package.json +1 -1
- package/bun.lockb +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { splitProps } from 'solid-js';
|
|
|
9
9
|
/** Like a {@link Match} but gets the value from the closest {@link On} ancestor */
|
|
10
10
|
export declare function Case(props: ParentProps<{
|
|
11
11
|
value: unknown;
|
|
12
|
-
}>): JSX;
|
|
12
|
+
}>): JSX.Element;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Eventually wraps its content into a template if a certain condition is met.
|
|
@@ -55,13 +55,13 @@ export declare class Extractor {
|
|
|
55
55
|
constructor(name?: string);
|
|
56
56
|
readonly ctx: Context<State | undefined>;
|
|
57
57
|
Joint: (props: {
|
|
58
|
-
children?: JSX;
|
|
59
|
-
}) => JSX;
|
|
60
|
-
Fallback: () => JSX;
|
|
58
|
+
children?: JSX.Element;
|
|
59
|
+
}) => JSX.Element;
|
|
60
|
+
Fallback: () => JSX.Element;
|
|
61
61
|
Dest: (props: {
|
|
62
62
|
hidden?: boolean | undefined;
|
|
63
|
-
}) => JSX;
|
|
64
|
-
Source: (props: Info) => JSX;
|
|
63
|
+
}) => JSX.Element;
|
|
64
|
+
Source: (props: Info) => JSX.Element;
|
|
65
65
|
/**
|
|
66
66
|
* Returns the number of destinations available for the current {@link Extractor}.
|
|
67
67
|
* It's a getter that returns a function that will be bound to the {@link Owner} in which the getter was called.
|
|
@@ -84,7 +84,8 @@ declare type Keyed<T> = Standard<T> & {
|
|
|
84
84
|
/**
|
|
85
85
|
* Memoizes some of the properties of {@link obj}.
|
|
86
86
|
* If {@link keys} is not provided, memoizes everything that get returned by {@link Reflect.ownKeys} when provided with {@link obj}.
|
|
87
|
-
* The {@link equals} parameter defaults to `false` to allow the specific reactive value to have control over when its dependant effects are triggered
|
|
87
|
+
* The {@link equals} parameter defaults to `false` to allow the specific reactive value to have control over when its dependant effects are triggered.
|
|
88
|
+
* The memoized properties have {@link NO_OP} as setter, this is needed because {@link Ref}s are assigned if they're not functions, so an `undefined` forwarded {@link Ref} would throw in that case (In strict contexts)
|
|
88
89
|
* @param obj Object to partially memoize
|
|
89
90
|
* @param keys The keys of the properties to memoize
|
|
90
91
|
* @param equals The comparator function to use on the newly created memos
|
|
@@ -120,7 +121,7 @@ export declare function memoProps<T, K extends readonly (keyof T)[]>(obj: T, key
|
|
|
120
121
|
export declare function On<T>(props: ParentProps<{
|
|
121
122
|
value: T;
|
|
122
123
|
onCompare?(a: unknown, b: T): boolean;
|
|
123
|
-
}>): JSX;
|
|
124
|
+
}>): JSX.Element;
|
|
124
125
|
|
|
125
126
|
/**
|
|
126
127
|
* Ordered linked list that allows for:
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { createMemo, splitProps, untrack, createRoot, getOwner, createComponent, Show, createContext, useContext, createRenderEffect, on, onCleanup, For, createSignal, createSelector, equalFn, Match } from "solid-js";
|
|
2
|
+
const NO_OP = () => {
|
|
3
|
+
};
|
|
2
4
|
function memoProps(obj, keys = Reflect.ownKeys(obj), equals = false) {
|
|
3
5
|
const out = {};
|
|
4
6
|
for (const elm of keys)
|
|
5
|
-
Object.defineProperty(out, elm, { enumerable: true, get: createMemo(() => obj[elm], void 0, { equals }) });
|
|
7
|
+
Object.defineProperty(out, elm, { enumerable: true, set: NO_OP, get: createMemo(() => obj[elm], void 0, { equals }) });
|
|
6
8
|
return out;
|
|
7
9
|
}
|
|
8
10
|
const splitAndMemoProps = (obj, ...keys) => {
|
|
@@ -120,7 +122,6 @@ class Extractor {
|
|
|
120
122
|
name
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
|
-
ctx;
|
|
124
125
|
Joint = Joint.bind(this);
|
|
125
126
|
Fallback = Fallback.bind(this);
|
|
126
127
|
Dest = Dest.bind(this);
|
package/dist/index.umd.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("solid-js")) : typeof define === "function" && define.amd ? define(["exports", "solid-js"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.solidCtrlFlow = {}, global.solidJs));
|
|
3
3
|
})(this, function(exports2, solidJs) {
|
|
4
4
|
"use strict";
|
|
5
|
+
const NO_OP = () => {
|
|
6
|
+
};
|
|
5
7
|
function memoProps(obj, keys = Reflect.ownKeys(obj), equals = false) {
|
|
6
8
|
const out = {};
|
|
7
9
|
for (const elm of keys)
|
|
8
|
-
Object.defineProperty(out, elm, { enumerable: true, get: solidJs.createMemo(() => obj[elm], void 0, { equals }) });
|
|
10
|
+
Object.defineProperty(out, elm, { enumerable: true, set: NO_OP, get: solidJs.createMemo(() => obj[elm], void 0, { equals }) });
|
|
9
11
|
return out;
|
|
10
12
|
}
|
|
11
13
|
const splitAndMemoProps = (obj, ...keys) => {
|
|
@@ -123,7 +125,6 @@
|
|
|
123
125
|
name
|
|
124
126
|
});
|
|
125
127
|
}
|
|
126
|
-
ctx;
|
|
127
128
|
Joint = Joint.bind(this);
|
|
128
129
|
Fallback = Fallback.bind(this);
|
|
129
130
|
Dest = Dest.bind(this);
|
package/package.json
CHANGED
package/bun.lockb
DELETED
|
Binary file
|