Skip to content

Commit

Permalink
feat: add cleanAllCache
Browse files Browse the repository at this point in the history
  • Loading branch information
drawcall committed Jul 24, 2024
1 parent f6f2bba commit a016444
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class FFCreator extends FFCon {
this.conf = new Conf(conf);
this.loader = new Loader();
this.destroyed = false;
this.cleanAllCache = true;

this.createApp();
this.createRenderer();
Expand Down Expand Up @@ -223,7 +224,7 @@ class FFCreator extends FFCon {
try {
this.app.render();
} catch (e) {
console.log(`App render eror:: ${e}`);
console.log(`App render erorr:: ${e}`);
}
}

Expand Down Expand Up @@ -400,7 +401,7 @@ class FFCreator extends FFCon {
this.app.destroy(true, true);
}

destroyAndCleanAllCache();
if (this.cleanAllCache) destroyAndCleanAllCache();
this.app = null;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffcreator",
"version": "7.5.1",
"version": "7.5.3",
"description": "FFCreator is a lightweight and flexible short video production library",
"main": "lib/index.js",
"types": "types/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions types/lib/FFCreator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ declare namespace FFCreatorSpace {
class FFCreator extends FFCon {
constructor(conf: FFCreatorConf);

inCenter: boolean;
destroyed: boolean;
cleanAllCache: boolean;

on<K extends keyof FFCreatorEventMap>(name: K, fn: (ev: FFCreatorEventMap[K]) => any): void;

/**
Expand Down

0 comments on commit a016444

Please sign in to comment.