mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 20:48:27 +00:00
little fix for withVal
This commit is contained in:
parent
524109056f
commit
9f56a335b7
@ -15,7 +15,7 @@ export function createParam(names) {
|
|||||||
let bag;
|
let bag;
|
||||||
// check if we have an object with an unnamed control (.value)
|
// check if we have an object with an unnamed control (.value)
|
||||||
if (typeof xs === 'object' && xs.value !== undefined) {
|
if (typeof xs === 'object' && xs.value !== undefined) {
|
||||||
bag = xs; // grab props that are already there
|
bag = { ...xs }; // grab props that are already there
|
||||||
xs = xs.value; // grab the unnamed control for this one
|
xs = xs.value; // grab the unnamed control for this one
|
||||||
delete bag.value;
|
delete bag.value;
|
||||||
}
|
}
|
||||||
@ -28,7 +28,8 @@ export function createParam(names) {
|
|||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
} else if (bag) {
|
} else if (bag) {
|
||||||
return { ...bag, [name]: xs };
|
bag[name] = xs;
|
||||||
|
return bag;
|
||||||
} else {
|
} else {
|
||||||
return { [name]: xs };
|
return { [name]: xs };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user