remove unused code

blockless
Rich Harris 2 years ago
parent b38669a8a0
commit 312322f1f4

@ -28,7 +28,6 @@ import {
} from './reconciler.js'; } from './reconciler.js';
import { import {
destroy_signal, destroy_signal,
push_destroy_fn,
untrack, untrack,
flush_sync, flush_sync,
push, push,
@ -1361,7 +1360,8 @@ export function bind_this(element_or_component, update, get_value, get_parts) {
// Add effect teardown (likely causes: if block became false, each item removed, component unmounted). // Add effect teardown (likely causes: if block became false, each item removed, component unmounted).
// In these cases we need to nullify the binding only if we detect that the value is still the same. // In these cases we need to nullify the binding only if we detect that the value is still the same.
// If not, that means that another effect has now taken over the binding. // If not, that means that another effect has now taken over the binding.
push_destroy_fn(e, () => { // TODO this is the only place we use this mechanism, see if we can get rid of it
e.y = () => {
// Defer to the next tick so that all updates can be reconciled first. // Defer to the next tick so that all updates can be reconciled first.
// This solves the case where one variable is shared across multiple this-bindings. // This solves the case where one variable is shared across multiple this-bindings.
effect(() => { effect(() => {
@ -1369,7 +1369,7 @@ export function bind_this(element_or_component, update, get_value, get_parts) {
update(null, ...parts); update(null, ...parts);
} }
}); });
}); };
} }
/** /**

@ -965,23 +965,6 @@ export function untrack(fn) {
} }
} }
/**
* @template V
* @param {import('#client').Effect} signal
* @param {() => void} destroy_fn
* @returns {void}
*/
export function push_destroy_fn(signal, destroy_fn) {
let destroy = signal.y;
if (destroy === null) {
signal.y = destroy_fn;
} else if (is_array(destroy)) {
destroy.push(destroy_fn);
} else {
signal.y = [destroy, destroy_fn];
}
}
const STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN); const STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
/** /**
* @template V * @template V

Loading…
Cancel
Save