Make inject_state and capture_state always available

pull/7738/head
Axelen123 6 years ago
parent 508f2e7e34
commit bdb8237cf8

@ -156,7 +156,11 @@ export default function dom(
() => {
return { ${component.vars.filter(prop => prop.writable).map(prop => prop.name).join(", ")} };
}
` : null;
` : deindent`
() => {
return {}
}
`;
inject_state = (uses_props || writable_props.length > 0) ? deindent`
${$$props} => {
@ -165,7 +169,11 @@ export default function dom(
if ('${prop.name}' in $$props) ${component.invalidate(prop.name, `${prop.name} = ${$$props}.${prop.name}`)};
`)}
}
` : null;
` : deindent`
${$$props} => {
return
}
`;
}
// instrument assignments

Loading…
Cancel
Save