store reset fix
This commit is contained in:
parent
d51ca40ab6
commit
3cdc64674b
2 changed files with 14 additions and 0 deletions
9
src/helpers/piniaReset.ts
Normal file
9
src/helpers/piniaReset.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { getActivePinia, type Pinia, type Store } from "pinia";
|
||||
|
||||
interface ExtendedPinia extends Pinia {
|
||||
_s: Map<string, Store>;
|
||||
}
|
||||
|
||||
export const resetAllPiniaStores = () => {
|
||||
(getActivePinia() as ExtendedPinia)?._s?.forEach((store: Store) => store.$reset());
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue