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 }) => { component.rewrite_props(({ name, reassigned, export_name }) => {
const value = `$${name}`; const value = `$${name}`;
let insert: Node[]; const insert = (reassigned || export_name)
if (reassigned || export_name) { ? b`${`$$subscribe_${name}`}()`
insert = b`${`$$subscribe_${name}`}()`; : b`@component_subscribe($$self, ${name}, #value => $$invalidate('${value}', ${value} = #value))`;
} else {
const callback = x`$$value => $$invalidate('${value}', ${value} = $$value)`;
insert = b`@component_subscribe($$self, ${name}, $${callback})`;
}
if (component.compile_options.dev) { if (component.compile_options.dev) {
insert = b`@validate_store(${name}, '${name}'); ${insert}`; return b`@validate_store(${name}, '${name}'); ${insert}`;
} }
return insert; return insert;

Loading…
Cancel
Save