You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Fixesvuejs#1491
…ile (#1517)
* 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
* Make action payload optional in definition file
vaga
pushed a commit
to vaga/vuex
that referenced
this issue
Apr 20, 2020
…ile (vuejs#1517)
* 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.
Fixesvuejs#1491
* Make action payload optional in definition file
Version
3.1.0
Reproduction link
https://github.com/vuejs/vuex/blob/dev/types/index.d.ts
Steps to reproduce
Test a mutation without payload on typescript
What is expected?
Typescript not complain about missing payload
What is actually happening?
Typescript complains about missing payload
change:
export type Mutation<S> = (state: S, payload: any) => any;
to:
export type Mutation<S> = (state: S, payload?: any) => any;
The text was updated successfully, but these errors were encountered: