Skip to content

Commit

Permalink
Make mutation payload optional in definition file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davidsandoz committed Mar 7, 2019
1 parent 041df8d commit 6f0063e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export interface ActionObject<S, R> {

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

export interface Module<S, R> {
Expand Down

0 comments on commit 6f0063e

Please sign in to comment.