9 lines
266 B
TypeScript
9 lines
266 B
TypeScript
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());
|
|
};
|