@builder.io/mitosis 0.1.6 → 0.1.7
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.
|
@@ -210,10 +210,14 @@ var componentToSolid = function (passedOptions) {
|
|
|
210
210
|
var newLocal = dep.replace(/(\.|\?|\(|\)|\[|\])/g, '_');
|
|
211
211
|
return "".concat(hookName, "_").concat(newLocal);
|
|
212
212
|
};
|
|
213
|
+
var needsMemo = function (dep) { return true; };
|
|
213
214
|
var reactiveDepsWorkaround = depsArray
|
|
215
|
+
.filter(needsMemo)
|
|
214
216
|
.map(function (dep) { return "const ".concat(getReactiveDepName(dep), " = createMemo(() => ").concat(dep, ");"); })
|
|
215
217
|
.join('\n');
|
|
216
|
-
var depsArrayStr = depsArray
|
|
218
|
+
var depsArrayStr = depsArray
|
|
219
|
+
.map(function (x) { return (needsMemo(x) ? "".concat(getReactiveDepName(x), "()") : x); })
|
|
220
|
+
.join(', ');
|
|
217
221
|
return "\n ".concat(reactiveDepsWorkaround, "\n function ").concat(hookName, "() { ").concat(hook.code, " };\n createEffect(on(() => [").concat(depsArrayStr, "], ").concat(hookName, "));\n ");
|
|
218
222
|
})
|
|
219
223
|
.join('\n')
|