Skip to content

Commit 0e5cac8

Browse files
Пинчук Виталий АПинчук Виталий А
Пинчук Виталий А
authored and
Пинчук Виталий А
committed
Trying to use direc-vuex with localActionContext
1 parent 9224a89 commit 0e5cac8

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "systemjs-ts-es6-vue",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/viT-1/systemjs-ts-es6-vue.git"
@@ -48,7 +48,7 @@
4848
"clj": "jest --clearCache"
4949
},
5050
"dependencies": {
51-
"direct-vuex": "0.10.2",
51+
"direct-vuex": "0.10.4",
5252
"promise-polyfill": "8.1.3",
5353
"express": "4.17.1",
5454
"systemjs": "5.0.0",

src/VueApp/store/VueApp.store.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export const storeConf = {
1313
} as const;
1414

1515
Vue.use(Vuex);
16-
export const { store, moduleActionContext } = createDirectStore(storeConf);
16+
export const { store } = createDirectStore(storeConf);

src/VueApp/store/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable import/no-cycle */
22
export {
3-
moduleActionContext,
43
store,
54
storeConf,
65
} from './VueApp.store';

src/jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const conf = {
5454
// Mapping which tests to run with jest
5555
testMatch: [
5656
// '**/*.*(spec|test).*(ts|js)',
57-
'**/SomeSvc/**/*.*(spec|test).*(ts|js)',
57+
'**/SomeForm/**/*.*(spec|test).*(ts|js)',
5858
],
5959
// File types reading
6060
transform: {

src/unique.blocks/SomeForm/SomeForm.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { SomeForm } from '.';
1111

1212
// flush async as sync & stub data
1313
jest.mock('@services/SomeSvc/SomeSvc.ts');
14-
// because of 'getters problem' https://github.com/paleo/direct-vuex/issues/25
15-
jest.mock('./store/actions.ts');
1614

1715
const localVue = createLocalVue();
1816
localVue.component('iam-select', IamSelect);

src/unique.blocks/SomeForm/store/actions.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ActionContext } from 'vuex';
22
// import { DirectActionContext } from 'direct-vuex/types/direct-types';
3+
import directVuex from 'direct-vuex';
4+
// import { localActionContext } from 'direct-vuex';
35

46
import { IOption as ISomeValue } from '@common/IamSelect/IamSelect.option.i';
57
import { SomeSvc } from '@services/SomeSvc';
@@ -8,9 +10,11 @@ import { IState } from './state.i';
810
import * as confMutations from './mutations.conf';
911
/* eslint-disable import/no-cycle */
1012
import { modSomeForm } from '.';
11-
import { moduleActionContext } from '~/VueApp/store';
13+
// import { moduleActionContext } from '~/VueApp/store';
1214

13-
const getTypedContext = (ctx: any) => moduleActionContext(ctx, modSomeForm);
15+
const { localActionContext } = directVuex;
16+
17+
const getTypedContext = (ctx: any) => localActionContext(ctx, modSomeForm);
1418

1519
export const getSomeValues = (
1620
// commit полученных данных выполняется другим (синхронным) action, потому dispatch

0 commit comments

Comments
 (0)