Skip to content

Commit dba6812

Browse files
committed
fixed commit issues
1 parent 4e931f6 commit dba6812

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,17 @@ Vuex today has additional functionalities like `$watch` `$subscribe` and `$subSc
150150

151151
This also possible with `vuex-class-component`
152152
```ts
153-
// Watch getters in vuex components
153+
// Watch getters in Vue components
154154
vxm.user.$watch( "fullname", newVal => {
155155
console.log( `Fullname has changed: ${newVal}` )
156156
});
157157

158-
// Subscribe to mutations in vuex components
158+
// Subscribe to mutations in Vue components
159159
vxm.user.$subscribe( "clearName", payload => {
160160
console.log( `clearName was called. payload: ${payload}` )
161161
});
162162

163-
// Subscribe to an action in vuex components
163+
// Subscribe to an action in Vue components
164164
vxm.user.$subscribeAction( "doSomethingAsync", {
165165
before: (payload :any) => console.log( payload ),
166166
after: (payload :any) => console.log( payload ),

dist/proxy.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/proxy.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/proxy.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/proxy.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/proxy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ function createGettersAndMutationProxyFromState({ cls, proxy, state, $store, nam
315315
}else return $store[ `__${className}_internal_getter__` ]( path )
316316
},
317317
set: payload => {
318-
if( $store.commit ) $store.commit( namespacedPath + `__${className}_internal_mutator__`, { field: path, payload });
318+
const commit = $store.commit || cls.prototype.__store_cache__.commit;
319+
if( commit ) commit( refineNamespacedPath( cls.prototype.__namespacedPath__ ) + `__${className}_internal_mutator__`, { field: path, payload });
319320
else {
320321
// We must be creating local proxies hence, $store.commit doesn't exist
321322
const store = cls.prototype.__context_store__!;

0 commit comments

Comments
 (0)