mirror of
https://github.com/motajs/template.git
synced 2026-11-02 23:14:34 +08:00
refactor: 加载系统重构
This commit is contained in:
1 parent
d12790280a
commit
cc434a6c66
27 files changed
+409
-266
No files matched your search
@@ -1,4 +1,4 @@
|
||||
export * from './progress';
|
||||
export * from './manager';
|
||||
export * from './starter';
|
||||
export * from './stream';
|
||||
export * from './task';
|
||||
|
||||
@@ -49,6 +49,11 @@ export class LoadManager
|
||||
}
|
||||
|
||||
async *load(): AsyncIterable<number> {
|
||||
for (const task of this.addedTasks) {
|
||||
if (!task.contentLoaded) {
|
||||
task.start();
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
if (this.loadedTasks.size === this.addedTasks.size) {
|
||||
return;
|
||||
Reference in new issue
Block a user