incremental-batches
Rich Harris 4 weeks ago
parent f48e4e2ec5
commit 8f2613df67

@ -87,7 +87,7 @@ export function derived(fn) {
f: flags,
fn,
reactions: null,
rv: 0,
rv: -1,
v: /** @type {V} */ (UNINITIALIZED),
wv: 0,
parent: parent_derived ?? active_effect,

@ -25,11 +25,12 @@ function clear_marked(deps) {
* @param {Set<Effect>} maybe_dirty_effects
*/
export function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
if ((effect.f & DIRTY) !== 0) {
dirty_effects.add(effect);
} else if ((effect.f & MAYBE_DIRTY) !== 0) {
maybe_dirty_effects.add(effect);
}
dirty_effects.add(effect);
// if ((effect.f & DIRTY) !== 0) {
// } else if ((effect.f & MAYBE_DIRTY) !== 0) {
// maybe_dirty_effects.add(effect);
// }
// Since we're not executing these effects now, we need to clear any WAS_MARKED flags
// so that other batches can correctly reach these effects during their own traversal

@ -156,6 +156,10 @@ export function increment_write_version() {
export function is_dirty(reaction) {
var flags = reaction.f;
if ((flags & REACTION_RAN) === 0) {
return true;
}
if (flags & DERIVED) {
reaction.f &= ~WAS_MARKED;
}

Loading…
Cancel
Save