finds.dev

championswimmer/vuex-module-decorators

TypeScript/ES7 Decorators to create Vuex modules declaratively

View on GitHubHomepage ↗

★ 1,765TypeScriptMITupdated Sep 2023

// the take

A decorator-based wrapper around Vuex that lets you write store modules as TypeScript classes (@Module, @Mutation, @Action) instead of the plain object shape Vuex normally wants. It's for Vue 2 / Vuex 3 projects that want less boilerplate and real type inference on store access via getModule().

The @MutationAction decorator (async method that auto-commits its return value) removes a genuinely annoying pattern you'd otherwise hand-write in every async action. getModule() gives fully typed access to both static and dynamically-registered modules, which vanilla Vuex can't do without manual typing gymnastics. Dynamic module registration and SSR module injection are both documented with working code, not just mentioned. Test suite actually covers the awkward cases — state factory isolation, namespaced getters/mutations across root and dynamic modules.

No pushes since September 2023, and the maintainer says outright this is a side project done for fun — don't expect timely fixes if something breaks on a newer Vue/TS/Babel combo. It's built on Vuex, which the Vue team has effectively deprecated in favor of Pinia; starting a new project on this stack today is a backward-looking choice. Uses the legacy `experimentalDecorators` TS flag / old Babel decorator transform, not the TC39 standard decorators TS 5+ ships with, so it's one tsconfig/babel upgrade away from breaking. CI badges point at Travis CI and LGTM.com, both shut down for years, so there's no visible evidence the test suite still runs on any change.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,765
Forks
162
Language
TypeScript
License
MIT
Last commit
1 Sep 2023

// nearby

If vuex-module-decorators isn't quite it.

All repos →