feat(store): add $destroy action

# What's changed?

* add action to remove store from global storage (thus destroying it)
This commit is contained in:
braks
2022-07-27 22:49:00 +02:00
committed by Braks
parent 98ff31154c
commit 73bf4db829
2 changed files with 6 additions and 0 deletions
@@ -65,6 +65,9 @@ export class Storage {
...toRefs(reactiveState),
emits,
id,
$destroy: () => {
this.remove(id)
},
}
this.set(id, flow)
+3
View File
@@ -189,6 +189,9 @@ export interface Actions extends ViewportFunctions {
/** reset state to defaults */
$reset: () => void
/** remove store instance from global storage and destroy it (will invalidate effect scopes) */
$destroy: () => void
}
export interface Getters {