MCPcopy
hub / github.com/vuejs/core / isDirty

Function isDirty

packages/reactivity/src/effect.ts:353–370  ·  view source on GitHub ↗
(sub: Subscriber)

Source from the content-addressed store, hash-verified

351}
352
353function isDirty(sub: Subscriber): boolean {
354 for (let link = sub.deps; link; link = link.nextDep) {
355 if (
356 link.dep.version !== link.version ||
357 (link.dep.computed &&
358 (refreshComputed(link.dep.computed) ||
359 link.dep.version !== link.version))
360 ) {
361 return true
362 }
363 }
364 // @ts-expect-error only for backwards compatibility where libs manually set
365 // this flag - e.g. Pinia's testing module
366 if (sub._dirty) {
367 return true
368 }
369 return false
370}
371
372/**
373 * Returning false indicates the refresh failed

Callers 3

runIfDirtyMethod · 0.85
dirtyMethod · 0.85
refreshComputedFunction · 0.85

Calls 1

refreshComputedFunction · 0.85

Tested by

no test coverage detected