Comments (8)
This issue has been resolved in the latest version
from vuex-class-component.
It seems like the options are used of the last extracted module, or something like that...
export class StoreA extends createModule({ namespaced: "StoreA", strict: true }) { }
export class StoreB extends createModule({ namespaced: "StoreB", strict: true }) { }
console.log(extractVuexModule(StoreA));
console.log(extractVuexModule(StoreB));
export class StoreC extends createModule({ namespaced: "StoreC", strict: true }) { }
console.log(extractVuexModule(StoreA));
console.log(extractVuexModule(StoreB));
console.log(extractVuexModule(StoreC));
prints
{StoreB: {…}}
{StoreB: {…}}
{StoreB: {…}}
{StoreB: {…}}
{StoreC: {…}}
from vuex-class-component.
Seems very likely this has something to do because you're using the prototype here, which is always VuexModule
:
vuex-class-component/src/module.ts
Line 18 in a374852
from vuex-class-component.
Mind sharing a sample project so I can replicate your issue.
Thanks
from vuex-class-component.
Here you go. I've added some console.log's to src/store.ts
yarn install
yarn serve
https://github.com/SaphuA/vuex-class-component-ns-repro
from vuex-class-component.
Looks ok! I'll do some more testing this week.
from vuex-class-component.
So when exactly should one use createModule
and when With
for providing options?
from vuex-class-component.
With is useful for extending already defined options.
Ideally you want to create a base configuration like so:
const VuexModule = createModule({
strict: false,
target: "nuxt",
enableLocalWatchers: true,
})
export class UserStore extends VuexModule.With({ namespaced: "user", strict: true }) {
}
Think of it as a 2 level inheritance for your module options.
from vuex-class-component.
Related Issues (20)
- Mutation requires object reference to change
- Cannot write independent tests because of module cache HOT 1
- Vuex 5 support and breaking changes
- TypeError: commit is not a function HOT 1
- Change the namespace later to create an abstract store
- [Bug] Actions force you to be async HOT 2
- ProxyWatchers small declaration issue
- watch, $subscribe and $subscribeAction all return void instead of the unsubscribe function HOT 1
- [BUG] npm package Version 2.3.2 still has pr #64 related issues. HOT 2
- Has no exported createModule
- [BUG]Mutation in Action doesn't work sometimes. HOT 2
- Calling getter in mutation HOT 1
- [Feature] ApiValue and ApiAction for fetching remote resources into store HOT 1
- Built files in "/dist" not updated? HOT 1
- [Bug] Store broken in 2.3.4 HOT 3
- [Bug] SSR data not saved in store when using nuxt fetch hook HOT 3
- Feature Request: A Bind decorator for class components
- Example on how to use with Nuxt HOT 3
- Access plugin on Action HOT 7
- Vue3 compatible HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuex-class-component.