]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
feat: improve tree shaking on `defineStore` (#2740)
authorSerKo <44749100+serkodev@users.noreply.github.com>
Thu, 15 Aug 2024 17:38:42 +0000 (01:38 +0800)
committerGitHub <noreply@github.com>
Thu, 15 Aug 2024 17:38:42 +0000 (19:38 +0200)
add `#__NO_SIDE_EFFECTS__` notation to `defineStore`

---------

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/pinia/src/store.ts

index 4cbec9f1264e7b6a896825e01e2f09d54a584274..923c4b120bec1869c441acf47e1d5b0d5a9dc7b1 100644 (file)
@@ -870,6 +870,8 @@ export function defineStore<Id extends string, SS>(
   _ExtractGettersFromSetupStore<SS>,
   _ExtractActionsFromSetupStore<SS>
 >
+// improves tree shaking
+/*#__NO_SIDE_EFFECTS__*/
 export function defineStore(
   // TODO: add proper types from above
   idOrOptions: any,