branch and block effects do not also need to be render effects

pull/15844/head
Rich Harris 3 months ago
parent 76b8d52de2
commit 3f3734b3fc

@ -271,7 +271,9 @@ export class Batch {
var skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);
if (!skip && effect.fn !== null) {
if ((flags & EFFECT_ASYNC) !== 0) {
if (is_branch) {
effect.f ^= CLEAN;
} else if ((flags & EFFECT_ASYNC) !== 0) {
const boundary = effect.b;
if (check_dirtiness(effect)) {
@ -282,8 +284,6 @@ export class Batch {
if (check_dirtiness(effect)) {
update_effect(effect);
}
} else if (is_branch) {
effect.f ^= CLEAN;
} else if ((flags & RENDER_EFFECT) !== 0) {
// we need to branch here because in legacy mode we run render effects
// before running block effects

@ -355,7 +355,7 @@ export function template_effect(fn, sync = [], async = []) {
* @param {number} flags
*/
export function block(fn, flags = 0) {
var effect = create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true);
var effect = create_effect(BLOCK_EFFECT | flags, fn, true);
if (DEV) {
effect.dev_stack = dev_stack;
}
@ -367,7 +367,7 @@ export function block(fn, flags = 0) {
* @param {boolean} [push]
*/
export function branch(fn, push = true) {
return create_effect(RENDER_EFFECT | BRANCH_EFFECT, fn, true, push);
return create_effect(BRANCH_EFFECT, fn, true, push);
}
/**

Loading…
Cancel
Save