pull/3665/head
Rich Harris 5 years ago committed by GitHub
parent 6a98febf5f
commit db901725ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -224,17 +224,12 @@ export default function dom(
component.rewrite_props(({ name, reassigned, export_name }) => {
const value = `$${name}`;
let insert: Node[];
if (reassigned || export_name) {
insert = b`${`$$subscribe_${name}`}()`;
} else {
const callback = x`$$value => $$invalidate('${value}', ${value} = $$value)`;
insert = b`@component_subscribe($$self, ${name}, $${callback})`;
}
const insert = (reassigned || export_name)
? b`${`$$subscribe_${name}`}()`
: b`@component_subscribe($$self, ${name}, #value => $$invalidate('${value}', ${value} = #value))`;
if (component.compile_options.dev) {
insert = b`@validate_store(${name}, '${name}'); ${insert}`;
return b`@validate_store(${name}, '${name}'); ${insert}`;
}
return insert;

Loading…
Cancel
Save