Skip to content

Commit

Permalink
feat: improve tree shaking on defineStore (#2740)
Browse files Browse the repository at this point in the history
add `#__NO_SIDE_EFFECTS__` notation to `defineStore`


---------

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
  • Loading branch information
serkodev and posva committed Aug 15, 2024
1 parent b90c595 commit 3069105
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/pinia/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3069105

Please sign in to comment.