Skip to content

Commit a97465d

Browse files
committed
simplify
1 parent 0b8d2fa commit a97465d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,8 @@ export function client_component(analysis, options) {
295295
}
296296

297297
if (binding?.kind === 'state' || binding?.kind === 'raw_state') {
298-
const value =
299-
binding.kind === 'state'
300-
? b.call('$.proxy', b.id('$$value'), b.call('$.get_options', b.id(name)))
301-
: b.id('$$value');
302-
return [getter, b.set(alias ?? name, [b.stmt(b.call('$.set', b.id(name), value))])];
298+
const call = b.call('$.set', b.id(name), b.id('$$value'), binding.kind === 'state' && b.true);
299+
return [getter, b.set(alias ?? name, [b.stmt(call)])];
303300
}
304301

305302
return getter;

0 commit comments

Comments
 (0)