]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commit
fix(types): actual generic store
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 23 Jul 2021 11:14:40 +0000 (13:14 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 23 Jul 2021 11:14:40 +0000 (13:14 +0200)
commite4c541fdd17ea97e25dfd45bd3378732ff6a344d
tree50c1d1778736fbe55cc19e8f08d9f570f356dda0
parent0da2099a587435130e4e3be12e9dd3e798918868
fix(types): actual generic store

BREAKING CHANGE: The existing `Store<Id, S, G, A>` types was trying to be generic when no types were specified but failing at it. Now, `Store` without any type will default to an empty Store. This enables a stricter version of `defineStore` when any of state, getters, and actions are missing. If you were using `Store` as a type, you should now use `StoreGeneric` instead, which also replaces `GenericStore` (marked as deprecated).
```diff
-function takeAnyStore(store: Store) {}
+function takeAnyStore(store: StoreGeneric) {}
```
14 files changed:
src/createPinia.ts
src/devtools/formatting.ts
src/devtools/plugin.ts
src/hmr.ts
src/index.ts
src/mapHelpers.ts
src/rootStore.ts
src/store.ts
src/testing.ts
src/types.ts
test-dts/customizations.test-d.ts
test-dts/index.d.ts
test-dts/plugins.test-d.ts
test-dts/store.test-d.ts