We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e78ea1d commit 4c6255fCopy full SHA for 4c6255f
packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js
@@ -242,13 +242,11 @@ export function BindDirective(node, context) {
242
if (node.name === 'this') {
243
context.state.init.push(b.stmt(call));
244
} else {
245
- const has_action_directive =
+ const has_use =
246
parent.type === 'RegularElement' && parent.attributes.find((a) => a.type === 'UseDirective');
247
248
- if (has_action_directive) {
249
- context.state.init.push(
250
- b.stmt(has_action_directive ? b.call('$.effect', b.thunk(call)) : call)
251
- );
+ if (has_use) {
+ context.state.init.push(b.stmt(b.call('$.effect', b.thunk(call))));
252
253
context.state.after_update.push(b.stmt(call));
254
}
0 commit comments