refactor: sync value access for chained computed w/ scheduler

This commit is contained in:
Evan You
2021-07-08 00:31:26 -04:00
parent 02339b67d8
commit 1fe2239270
4 changed files with 132 additions and 41 deletions

View File

@@ -1630,15 +1630,14 @@ function baseCreateRenderer(
const effect = new ReactiveEffect(
componentUpdateFn,
() => queueJob(instance.update),
instance.scope, // track it in component's effect scope
true /* allowRecurse */
instance.scope // track it in component's effect scope
)
const update = (instance.update = effect.run.bind(effect) as SchedulerJob)
update.id = instance.uid
// allowRecurse
// #1801, #2043 component render effects should allow recursive updates
update.allowRecurse = true
effect.allowRecurse = update.allowRecurse = true
if (__DEV__) {
effect.onTrack = instance.rtc