From 6f0063e5d372c5d86a001ffe9babc9800d2a423f Mon Sep 17 00:00:00 2001 From: David Sandoz Date: Thu, 7 Mar 2019 15:15:33 +0100 Subject: [PATCH] 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 #1491 --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 46316bb2a..6c274b1b5 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -105,7 +105,7 @@ export interface ActionObject { export type Getter = (state: S, getters: any, rootState: R, rootGetters: any) => any; export type Action = ActionHandler | ActionObject; -export type Mutation = (state: S, payload: any) => any; +export type Mutation = (state: S, payload?: any) => any; export type Plugin = (store: Store) => any; export interface Module {