From: DevilTea Date: Thu, 24 Nov 2022 08:56:52 +0000 (+0800) Subject: docs(store): `$dispose` doesn't delete store state (#1824) X-Git-Tag: @pinia/nuxt@0.4.6~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=269205fc769483ee01d0763cdde543d9119b89b1;p=thirdparty%2Fvuejs%2Fpinia.git docs(store): `$dispose` doesn't delete store state (#1824) Co-authored-by: Eduardo San Martin Morote Close https://github.com/vuejs/pinia/issues/1821 --- diff --git a/packages/pinia/src/types.ts b/packages/pinia/src/types.ts index 52d2e90c..4907fc6c 100644 --- a/packages/pinia/src/types.ts +++ b/packages/pinia/src/types.ts @@ -410,6 +410,9 @@ export interface _StoreWithState< * Stops the associated effect scope of the store and remove it from the store * registry. Plugins can override this method to cleanup any added effects. * e.g. devtools plugin stops displaying disposed stores from devtools. + * Note this doesn't delete the state of the store, you have to do it manually with + * `delete pinia.state.value[store.$id]` if you want to. If you don't and the + * store is used again, it will reuse the previous state. */ $dispose(): void