]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs(store): `$dispose` doesn't delete store state (#1824)
authorDevilTea <ch19980814@gmail.com>
Thu, 24 Nov 2022 08:56:52 +0000 (16:56 +0800)
committerGitHub <noreply@github.com>
Thu, 24 Nov 2022 08:56:52 +0000 (09:56 +0100)
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
Close https://github.com/vuejs/pinia/issues/1821

packages/pinia/src/types.ts

index 52d2e90c0aa5c5d646280d244d65cfb2919c6932..4907fc6ce5c5491532db38860fa790f015ada45b 100644 (file)
@@ -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