We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given an action wit optional parameter: async testIt(context: TestContext, payload?: number): Promise<void> {}
async testIt(context: TestContext, payload?: number): Promise<void> {}
Is mapped with: export const testAction = dispatch(test.actions.testIt)
export const testAction = dispatch(test.actions.testIt)
When you call the action inside a VUE Component with the optional parameter: test.testAction(this.$store, 123)
test.testAction(this.$store, 123)
You will get a compile error: Expected 1 arguments, but got 2.
Expected 1 arguments, but got 2.
The text was updated successfully, but these errors were encountered:
I just ran into this issue, but for mutations using the commit() method:
commit()
const storeOptions = { ..., mutations: { setSomeValue(state: RootState, someValue?: string) { state.someValue = someValue; }, ... } }; export const commitSomeValue = commit(mutations.setSomeValue);
Generates a type signature for commitSomeValue:
const commitSomeValue: (store: ActionContext<RootState, RootState> | Store<RootState>) => void
instead of:
const commitSomeValue: (store: ActionContext<RootState, RootState> | Store<RootState>, someValue: string | undefined) => void
As a workaround, I just changed the types for setSomeValue to:
setSomeValue
const setSomeValue: (state: RootState, someValue: string | undefined) => void
instead of using the optional ? syntax.
?
Sorry, something went wrong.
No branches or pull requests
Given an action wit optional parameter:
async testIt(context: TestContext, payload?: number): Promise<void> {}
Is mapped with:
export const testAction = dispatch(test.actions.testIt)
When you call the action inside a VUE Component with the optional parameter:
test.testAction(this.$store, 123)
You will get a compile error:
Expected 1 arguments, but got 2.
The text was updated successfully, but these errors were encountered: