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
First of all, thank you, @ktsn, for a great library! I've been using it for over half a year and it's extremely useful 👍
I've prepared a small example to demonstrate the issue:
import{Getters,Mutations,Actions}from'vuex-smart-module';exportclassTestState{}exportclassTestGettersextendsGetters<TestState>{}exportclassTestMutationsextendsMutations<TestState>{methodWithOverload(): void;methodWithOverload(payload: number): void;methodWithOverload(payload: string): void;methodWithOverload(payload?: number|string): void{// ...}testMutation(){// (method) TestMutations.methodWithOverload(): void (+2 overloads)this.methodWithOverload();this.methodWithOverload(1);this.methodWithOverload('test');}}exportclassTestActionsextendsActions<TestState,TestGetters,TestMutations,TestActions>{testAction(){// (method) methodWithOverload(payload?: string | undefined): voidthis.mutations.methodWithOverload();this.mutations.methodWithOverload(1);// <-- Argument of type '1' is not assignable to parameter of type 'string | undefined'.this.mutations.methodWithOverload('test');this.commit('methodWithOverload');this.commit('methodWithOverload',1);// <-- Argument of type 'number' is not assignable to parameter of type 'string'.this.commit('methodWithOverload','test');}}
As you can see, when we call methodWithOverload from Actions, its type is not the same as the original.
vue: 2.6.11
vuex: 3.4.0
vuex-smart-module: 0.4.5
typescript: 3.9.3
The text was updated successfully, but these errors were encountered:
First of all, thank you, @ktsn, for a great library! I've been using it for over half a year and it's extremely useful 👍
I've prepared a small example to demonstrate the issue:
As you can see, when we call
methodWithOverload
from Actions, its type is not the same as the original.The text was updated successfully, but these errors were encountered: