Conversation
Using StoreObject instead of State allows for more type-safe calls to the Vuex API from client. * The inside of StoreObject-calls(ex, commit()) may have `any` type * mapXxx() are not changed.
|
Drive-by comment: thanks for working on this! I don't understand the generics involved in You retracted pull/1943, which seems to be the same thing, but doing the above |
|
@tommie const s = {
modules: {
foo: {
modules: {
hoge: {
actions: {
bar: (n: number) => "aaa",
},
},
},
},
bar: {
actions: {
bal: (x: string) => "aaa",
},
},
},
};to {
"bar/bal": (x: string) => string,
"foo/hoge/bar": (n: number) => string
}
Yes. // store is instance of vuex
const key: InjectionKey<typeof store> = Symbol('key')
const usedStore = Vuex.useStore(key)
Initially, I have intended to send out the PR to my repo, but I made a mistake and created 1943. So, I reflexively closed it. |

Using StoreObject instead of State allows for more
type-safe calls to the Vuex API from client.
store.dispatch(),store.commit()has namespaced-typed params and their payloadsanytyperoot,namespacedflagsand changed code formats.
Please see