@flexsurfer/reflex 0.1.6 → 0.1.8
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.cjs +15 -3
- package/dist/index.d.cts +4 -7
- package/dist/index.d.ts +4 -7
- package/dist/index.mjs +15 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -508,7 +508,15 @@ var doFxInterceptor = {
|
|
|
508
508
|
consoleLog("warn", `[reflex] effects expects a vector, but was given ${typeof effects}`);
|
|
509
509
|
return context;
|
|
510
510
|
}
|
|
511
|
-
effects.
|
|
511
|
+
effects.forEach((effect) => {
|
|
512
|
+
if (!effect) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
if (!Array.isArray(effect) || effect.length === 0 || effect.length > 2) {
|
|
516
|
+
consoleLog("warn", `[reflex] invalid effect in effects:`, effect);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
const [key, val] = effect;
|
|
512
520
|
const effectFn = getHandler(KIND2, key);
|
|
513
521
|
if (effectFn) {
|
|
514
522
|
try {
|
|
@@ -1189,8 +1197,12 @@ function setupSubsHotReload() {
|
|
|
1189
1197
|
return { dispose, accept };
|
|
1190
1198
|
}
|
|
1191
1199
|
function HotReloadWrapper({ children }) {
|
|
1192
|
-
|
|
1193
|
-
|
|
1200
|
+
if (isDebugEnabled()) {
|
|
1201
|
+
const key = useHotReloadKey();
|
|
1202
|
+
return import_react2.default.createElement(import_react2.default.Fragment, { key }, children);
|
|
1203
|
+
} else {
|
|
1204
|
+
return children;
|
|
1205
|
+
}
|
|
1194
1206
|
}
|
|
1195
1207
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1196
1208
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -13,7 +13,7 @@ type ErrorHandler = (originalError: Error, reFrameError: Error & {
|
|
|
13
13
|
type SubVector = [Id, ...any[]];
|
|
14
14
|
type SubHandler = (...values: any[]) => any;
|
|
15
15
|
type SubDepsHandler = (...params: any[]) => SubVector[];
|
|
16
|
-
type Effects = [string, any][];
|
|
16
|
+
type Effects = [string, any?][];
|
|
17
17
|
interface DispatchLaterEffect {
|
|
18
18
|
ms: number;
|
|
19
19
|
dispatch: EventVector;
|
|
@@ -178,12 +178,9 @@ declare function setupSubsHotReload(): {
|
|
|
178
178
|
*/
|
|
179
179
|
declare function HotReloadWrapper({ children }: {
|
|
180
180
|
children: React.ReactNode;
|
|
181
|
-
}): React.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
display: "contents";
|
|
185
|
-
};
|
|
186
|
-
}, HTMLElement>;
|
|
181
|
+
}): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.FunctionComponentElement<{
|
|
182
|
+
children?: React.ReactNode | undefined;
|
|
183
|
+
}> | null | undefined;
|
|
187
184
|
|
|
188
185
|
type TraceID = number;
|
|
189
186
|
interface TraceOpts {
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type ErrorHandler = (originalError: Error, reFrameError: Error & {
|
|
|
13
13
|
type SubVector = [Id, ...any[]];
|
|
14
14
|
type SubHandler = (...values: any[]) => any;
|
|
15
15
|
type SubDepsHandler = (...params: any[]) => SubVector[];
|
|
16
|
-
type Effects = [string, any][];
|
|
16
|
+
type Effects = [string, any?][];
|
|
17
17
|
interface DispatchLaterEffect {
|
|
18
18
|
ms: number;
|
|
19
19
|
dispatch: EventVector;
|
|
@@ -178,12 +178,9 @@ declare function setupSubsHotReload(): {
|
|
|
178
178
|
*/
|
|
179
179
|
declare function HotReloadWrapper({ children }: {
|
|
180
180
|
children: React.ReactNode;
|
|
181
|
-
}): React.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
display: "contents";
|
|
185
|
-
};
|
|
186
|
-
}, HTMLElement>;
|
|
181
|
+
}): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.FunctionComponentElement<{
|
|
182
|
+
children?: React.ReactNode | undefined;
|
|
183
|
+
}> | null | undefined;
|
|
187
184
|
|
|
188
185
|
type TraceID = number;
|
|
189
186
|
interface TraceOpts {
|
package/dist/index.mjs
CHANGED
|
@@ -441,7 +441,15 @@ var doFxInterceptor = {
|
|
|
441
441
|
consoleLog("warn", `[reflex] effects expects a vector, but was given ${typeof effects}`);
|
|
442
442
|
return context;
|
|
443
443
|
}
|
|
444
|
-
effects.
|
|
444
|
+
effects.forEach((effect) => {
|
|
445
|
+
if (!effect) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
if (!Array.isArray(effect) || effect.length === 0 || effect.length > 2) {
|
|
449
|
+
consoleLog("warn", `[reflex] invalid effect in effects:`, effect);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const [key, val] = effect;
|
|
445
453
|
const effectFn = getHandler(KIND2, key);
|
|
446
454
|
if (effectFn) {
|
|
447
455
|
try {
|
|
@@ -1122,8 +1130,12 @@ function setupSubsHotReload() {
|
|
|
1122
1130
|
return { dispose, accept };
|
|
1123
1131
|
}
|
|
1124
1132
|
function HotReloadWrapper({ children }) {
|
|
1125
|
-
|
|
1126
|
-
|
|
1133
|
+
if (isDebugEnabled()) {
|
|
1134
|
+
const key = useHotReloadKey();
|
|
1135
|
+
return React.createElement(React.Fragment, { key }, children);
|
|
1136
|
+
} else {
|
|
1137
|
+
return children;
|
|
1138
|
+
}
|
|
1127
1139
|
}
|
|
1128
1140
|
export {
|
|
1129
1141
|
HotReloadWrapper,
|