This commit is contained in:
syuilo
2020-12-28 19:57:09 +09:00
parent 1157298eb8
commit 1669f5b265
3 changed files with 3 additions and 2 deletions

View File

@@ -109,6 +109,8 @@ export class Storage<T extends StateDef> {
const stop = watch(this.reactiveState[key], val => {
valueRef.value = val;
});
// NOTE: vueコンポーネント内で呼ばれない限りは、onUnmounted は無意味なのでメモリリークする
onUnmounted(() => {
stop();
});