Skip to content

Commit df3779d

Browse files
committed
WIP
1 parent c2cd807 commit df3779d

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

packages/svelte/src/internal/client/proxy.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,10 @@ import {
1414
import { PROXY_ONCHANGE_SYMBOL, STATE_SYMBOL } from './constants.js';
1515
import { get_stack } from './dev/tracing.js';
1616
import * as e from './errors.js';
17-
import { batch_onchange, set, source, state } from './reactivity/sources.js';
17+
import { set, source, state } from './reactivity/sources.js';
1818

1919
const array_methods = ['push', 'pop', 'shift', 'unshift', 'splice', 'reverse', 'sort'];
2020

21-
/**
22-
* Used to prevent batching in case we are not setting the length of an array
23-
* @param {any} fn
24-
* @returns
25-
*/
26-
function identity(fn) {
27-
return fn;
28-
}
29-
3021
/**
3122
* @template T
3223
* @param {T} value

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import {
2727
UNOWNED,
2828
MAYBE_DIRTY,
2929
BLOCK_EFFECT,
30-
ROOT_EFFECT,
31-
PROXY_ONCHANGE_SYMBOL
30+
ROOT_EFFECT
3231
} from '../constants.js';
3332
import * as e from '../errors.js';
3433
import { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';
@@ -47,32 +46,6 @@ export function set_inspect_effects(v) {
4746
inspect_effects = v;
4847
}
4948

50-
/** @type {null | Set<() => void>} */
51-
let onchange_batch = null;
52-
53-
/**
54-
* @param {Function} fn
55-
*/
56-
export function batch_onchange(fn) {
57-
// @ts-expect-error
58-
return function (...args) {
59-
let previous_onchange_batch = onchange_batch;
60-
61-
try {
62-
onchange_batch = new Set();
63-
64-
// @ts-expect-error
65-
return fn.apply(this, args);
66-
} finally {
67-
for (const onchange of /** @type {Set<() => void>} */ (onchange_batch)) {
68-
onchange();
69-
}
70-
71-
onchange_batch = previous_onchange_batch;
72-
}
73-
};
74-
}
75-
7649
/**
7750
* @template V
7851
* @param {V} v

0 commit comments

Comments
 (0)