chore: remove unnecessary ternary (#14045)

pull/14048/head
Rich Harris 6 days ago committed by GitHub
parent e78ea1d555
commit 4c6255f8dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -242,13 +242,11 @@ export function BindDirective(node, context) {
if (node.name === 'this') {
context.state.init.push(b.stmt(call));
} else {
const has_action_directive =
const has_use =
parent.type === 'RegularElement' && parent.attributes.find((a) => a.type === 'UseDirective');
if (has_action_directive) {
context.state.init.push(
b.stmt(has_action_directive ? b.call('$.effect', b.thunk(call)) : call)
);
if (has_use) {
context.state.init.push(b.stmt(b.call('$.effect', b.thunk(call))));
} else {
context.state.after_update.push(b.stmt(call));
}

Loading…
Cancel
Save