always push

each-branch-manager
Rich Harris 2 days ago
parent 369023389c
commit 32cefa280b

@ -80,10 +80,9 @@ function push_effect(effect, parent_effect) {
* @param {number} type * @param {number} type
* @param {null | (() => void | (() => void))} fn * @param {null | (() => void | (() => void))} fn
* @param {boolean} sync * @param {boolean} sync
* @param {boolean} push
* @returns {Effect} * @returns {Effect}
*/ */
function create_effect(type, fn, sync, push = true) { function create_effect(type, fn, sync) {
var parent = active_effect; var parent = active_effect;
if (DEV) { if (DEV) {
@ -133,7 +132,6 @@ function create_effect(type, fn, sync, push = true) {
schedule_effect(effect); schedule_effect(effect);
} }
if (push) {
/** @type {Effect | null} */ /** @type {Effect | null} */
var e = effect; var e = effect;
@ -171,9 +169,6 @@ function create_effect(type, fn, sync, push = true) {
(derived.effects ??= []).push(e); (derived.effects ??= []).push(e);
} }
} }
} else {
console.trace('not pushing');
}
return effect; return effect;
} }
@ -388,13 +383,11 @@ export function block(fn, flags = 0) {
return effect; return effect;
} }
// TODO i think we don't need `push` any more?
/** /**
* @param {(() => void)} fn * @param {(() => void)} fn
* @param {boolean} [push]
*/ */
export function branch(fn, push = true) { export function branch(fn) {
return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true, push); return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);
} }
/** /**

Loading…
Cancel
Save