| 123 | } |
| 124 | |
| 125 | export function queuePostFlushCb(cb: SchedulerJobs): void { |
| 126 | if (!isArray(cb)) { |
| 127 | if (activePostFlushCbs && cb.id === -1) { |
| 128 | activePostFlushCbs.splice(postFlushIndex + 1, 0, cb) |
| 129 | } else if (!(cb.flags! & SchedulerJobFlags.QUEUED)) { |
| 130 | pendingPostFlushCbs.push(cb) |
| 131 | cb.flags! |= SchedulerJobFlags.QUEUED |
| 132 | } |
| 133 | } else { |
| 134 | // if cb is an array, it is a component lifecycle hook which can only be |
| 135 | // triggered by a job, which is already deduped in the main queue, so |
| 136 | // we can skip duplicate check here to improve perf |
| 137 | pendingPostFlushCbs.push(...cb) |
| 138 | } |
| 139 | queueFlush() |
| 140 | } |
| 141 | |
| 142 | export function flushPreFlushCbs( |
| 143 | instance?: ComponentInternalInstance, |