Skip to content

Commit 6f0063e

Browse files
authored
Make mutation payload optional in definition file
When testing a mutation without payload in TypeScript, it complains that about the missing payload, even though it's not mandatory. This PR simply makes the payload optional. Fixes vuejs#1491
1 parent 041df8d commit 6f0063e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export interface ActionObject<S, R> {
105105

106106
export type Getter<S, R> = (state: S, getters: any, rootState: R, rootGetters: any) => any;
107107
export type Action<S, R> = ActionHandler<S, R> | ActionObject<S, R>;
108-
export type Mutation<S> = (state: S, payload: any) => any;
108+
export type Mutation<S> = (state: S, payload?: any) => any;
109109
export type Plugin<S> = (store: Store<S>) => any;
110110

111111
export interface Module<S, R> {

0 commit comments

Comments
 (0)