|
|
|
@ -361,7 +361,8 @@ export function prop(props, key, flags, fallback) {
|
|
|
|
|
// means we can just call `$$props.foo = value` directly
|
|
|
|
|
if (setter) {
|
|
|
|
|
var legacy_parent = props.$$legacy;
|
|
|
|
|
return /** @type {() => V} */ (function (/** @type {V} */ value, /** @type {boolean} */ mutation) {
|
|
|
|
|
return /** @type {() => V} */ (
|
|
|
|
|
function (/** @type {V} */ value, /** @type {boolean} */ mutation) {
|
|
|
|
|
if (arguments.length > 0) {
|
|
|
|
|
// We don't want to notify if the value was mutated and the parent is in runes mode.
|
|
|
|
|
// In that case the state proxy (if it exists) should take care of the notification.
|
|
|
|
@ -375,7 +376,8 @@ export function prop(props, key, flags, fallback) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return getter();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Either prop is written to, but there's no binding, which means we
|
|
|
|
@ -398,7 +400,8 @@ export function prop(props, key, flags, fallback) {
|
|
|
|
|
|
|
|
|
|
var parent_effect = /** @type {Effect} */ (active_effect);
|
|
|
|
|
|
|
|
|
|
return /** @type {() => V} */(function (/** @type {any} */ value, /** @type {boolean} */ mutation) {
|
|
|
|
|
return /** @type {() => V} */ (
|
|
|
|
|
function (/** @type {any} */ value, /** @type {boolean} */ mutation) {
|
|
|
|
|
if (arguments.length > 0) {
|
|
|
|
|
const new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;
|
|
|
|
|
|
|
|
|
@ -422,5 +425,6 @@ export function prop(props, key, flags, fallback) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return get(d);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|