Skip to content

Posts tagged vue 3

Posts under this tag. Back to all posts when you want the full stream.

@latest_post

TIL: How to reset all stores in Pinia

I just learned that every Pinia store has a $reset function.

To reset all in-use stores you just need to:

TypeScript
import { getActivePinia } from 'pinia'
const pinia = getActivePinia()
pinia._s.forEach((store) => store.$reset())

: https://stackoverflow.com/questions/71690883/pinia-reset-alternative-when-using-setup-syntax "Pinia: $reset alternative when using setup syntax" -->