We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd8d1e9 commit 0457804Copy full SHA for 0457804
src/adapter/shared/serialize.ts
@@ -211,13 +211,14 @@ export function maybeSetSignal(
211
path: ObjPath,
212
value: any,
213
) {
214
- const last = path.slice().pop();
215
- const parent = path.reduce((acc, attr) => (acc ? acc[attr] : null), obj);
216
- if (parent && last) {
217
- if (isSignal(parent)) {
218
- parent.value = value;
+ let current: any = obj;
+ for (let i = 0; i < path.length; i++) {
+ if (isSignal(current)) {
+ current.value = value;
219
return true;
220
}
+
221
+ current = current[path[i]];
222
223
224
return false;
0 commit comments