Skip to content

Commit 4c6255f

Browse files
authored
chore: remove unnecessary ternary (#14045)
1 parent e78ea1d commit 4c6255f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,11 @@ export function BindDirective(node, context) {
242242
if (node.name === 'this') {
243243
context.state.init.push(b.stmt(call));
244244
} else {
245-
const has_action_directive =
245+
const has_use =
246246
parent.type === 'RegularElement' && parent.attributes.find((a) => a.type === 'UseDirective');
247247

248-
if (has_action_directive) {
249-
context.state.init.push(
250-
b.stmt(has_action_directive ? b.call('$.effect', b.thunk(call)) : call)
251-
);
248+
if (has_use) {
249+
context.state.init.push(b.stmt(b.call('$.effect', b.thunk(call))));
252250
} else {
253251
context.state.after_update.push(b.stmt(call));
254252
}

0 commit comments

Comments
 (0)