MCPcopy
hub / github.com/sveltejs/svelte / update_pre

Function update_pre

packages/svelte/src/internal/client/reactivity/sources.js:315–321  ·  view source on GitHub ↗
(source, d = 1)

Source from the content-addressed store, hash-verified

313 * @returns {T}
314 */
315export function update_pre(source, d = 1) {
316 var value = get(source);
317
318 // @ts-expect-error
319 // eslint-disable-next-line no-useless-assignment -- `++`/`--` used for return value, not side effect on `value`
320 return set(source, d === 1 ? ++value : --value);
321}
322
323/**
324 * Silently (without using `get`) increment a source

Callers 1

test.tsFile · 0.90

Calls 2

getFunction · 0.90
setFunction · 0.70

Tested by

no test coverage detected