add draw cleanup
This commit is contained in:
parent
0b206a4d50
commit
1d1d29a163
2 changed files with 12 additions and 0 deletions
|
|
@ -41,3 +41,14 @@ export const queryEvents = (pattern, callback, seconds) => {
|
|||
queryEvents();
|
||||
}, seconds * 1.5 * 1000);
|
||||
};
|
||||
|
||||
export const cleanup = () => {
|
||||
const ctx = getDrawContext();
|
||||
ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
|
||||
if (window.strudelAnimation) {
|
||||
cancelAnimationFrame(window.strudelAnimation);
|
||||
}
|
||||
if (window.strudelScheduler) {
|
||||
clearInterval(window.strudelScheduler);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue