Skip to content

Commit bce2575

Browse files
committed
cleaned up issues
1 parent c1dbf54 commit bce2575

File tree

8 files changed

+19
-91
lines changed

8 files changed

+19
-91
lines changed

dist/interfaces.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ export interface SubModuleType<T> {
4747
export declare type DictionaryField = string | number | symbol;
4848
export interface VuexObject {
4949
namespaced: boolean | undefined;
50-
state: Record<DictionaryField, any>;
51-
mutations: Record<DictionaryField, any>;
52-
getters: Record<DictionaryField, any>;
53-
actions: Record<DictionaryField, any>;
50+
state: Map | Function;
51+
mutations: Map;
52+
getters: Map;
53+
actions: Map;
5454
modules: Record<DictionaryField, VuexObject>;
5555
}
5656
export declare type Map = Record<DictionaryField, any>;

dist/proxy.js

Lines changed: 4 additions & 25 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/interfaces.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ export interface SubModuleType<T> {
4747
export declare type DictionaryField = string | number | symbol;
4848
export interface VuexObject {
4949
namespaced: boolean | undefined;
50-
state: Record<DictionaryField, any>;
51-
mutations: Record<DictionaryField, any>;
52-
getters: Record<DictionaryField, any>;
53-
actions: Record<DictionaryField, any>;
50+
state: Map | Function;
51+
mutations: Map;
52+
getters: Map;
53+
actions: Map;
5454
modules: Record<DictionaryField, VuexObject>;
5555
}
5656
export declare type Map = Record<DictionaryField, any>;

js/proxy.js

Lines changed: 4 additions & 25 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/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export type DictionaryField = string | number | symbol
5959

6060
export interface VuexObject {
6161
namespaced :boolean | undefined;
62-
state :Map | (() => Map);
62+
state :Map | Function;
6363
mutations :Map
6464
getters :Map
6565
actions :Map

src/proxy.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -498,36 +498,6 @@ function createActionProxy({ cls, actions, proxy, $store, namespacedPath } :Acti
498498
}
499499
}
500500

501-
function runSetterCheck( cls :VuexModuleConstructor, getters :Map ) {
502-
// if there are setters defined that are not in getters.
503-
// throw an error.
504-
const setterMutations = cls.prototype.__mutations_cache__ && cls.prototype.__mutations_cache__.__setter_mutations__ || {};
505-
for( let field in setterMutations ) {
506-
const setterIsNotInGetters = Object.keys( getters ).indexOf( field ) < 0;
507-
if( setterIsNotInGetters ) {
508-
509-
throw new Error(
510-
`\nImproper Use of Setter Mutations:\n` +
511-
`at >>\n` +
512-
`set ${ field }( payload ) {\n` +
513-
`\t...\n` +
514-
`}\n` +
515-
`\n` +
516-
`Setter mutations should only be used if there is a corresponding getter defined.\n` +
517-
`\n` +
518-
`Either define a corresponding getter for this setter mutation or,\n` +
519-
`Define them as an explicit mutation using function assignment.\n` +
520-
`Example:\n` +
521-
`--------------------\n` +
522-
`${ field } = ( payload ) => {\n` +
523-
` ...\n` +
524-
`}`
525-
)
526-
527-
}
528-
}
529-
}
530-
531501
interface ProxyCreator {
532502
proxy :Map;
533503
$store :any;

0 commit comments

Comments
 (0)