Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 1, 2024
1 parent a4977fb commit 99c354d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,17 +991,12 @@ function get_parent_context(component_context) {
*/
export function update(signal, d = 1) {
var value = get(signal);
var result = d === 1 ? value++ : value--;

if (typeof value === 'bigint') {
// @ts-expect-error
set(signal, value + BigInt(d));
return value;
}
set(signal, value);

// @ts-expect-error
set(signal, +value + d);
// @ts-expect-error
return +value;
return result;
}

/**
Expand Down

0 comments on commit 99c354d

Please sign in to comment.