feat(store): add $destroy action
# What's changed? * add action to remove store from global storage (thus destroying it)
This commit is contained in:
@@ -65,6 +65,9 @@ export class Storage {
|
||||
...toRefs(reactiveState),
|
||||
emits,
|
||||
id,
|
||||
$destroy: () => {
|
||||
this.remove(id)
|
||||
},
|
||||
}
|
||||
|
||||
this.set(id, flow)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user