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),
|
...toRefs(reactiveState),
|
||||||
emits,
|
emits,
|
||||||
id,
|
id,
|
||||||
|
$destroy: () => {
|
||||||
|
this.remove(id)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set(id, flow)
|
this.set(id, flow)
|
||||||
|
|||||||
@@ -189,6 +189,9 @@ export interface Actions extends ViewportFunctions {
|
|||||||
|
|
||||||
/** reset state to defaults */
|
/** reset state to defaults */
|
||||||
$reset: () => void
|
$reset: () => void
|
||||||
|
|
||||||
|
/** remove store instance from global storage and destroy it (will invalidate effect scopes) */
|
||||||
|
$destroy: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Getters {
|
export interface Getters {
|
||||||
|
|||||||
Reference in New Issue
Block a user