
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
vuex-typescript-commit-dispatch-prompt
Advanced tools
vuex-typescript-commit-dispatch-prompt is a tool for vuex and TypeScript 4.1+。
npm install typescript@beta --save-dev
npm i vuex-typescript-commit-dispatch-prompt --save
then modify your store.ts
import Vuex from 'vuex';
import createLogger from 'vuex/dist/logger';
import { GetActionsType, GetMutationsType, GetPayLoad, GetReturnType } from 'vuex-typescript-commit-dispatch-prompt';
const vuexOptions = {
state,
getters,
actions,
mutations,
modules: {
home,
detail,
},
plugins: process.env.NODE_ENV === 'development' ? [createLogger()] : [],
};
type Mutations = GetMutationsType<typeof vuexOptions>;
type Actions = GetActionsType<typeof vuexOptions>;
declare module 'vuex' {
export interface Commit {
<T extends keyof Mutations>(type: T, payload?: GetPayLoad<Mutations, T>, options?: CommitOptions): GetReturnType<Mutations, T>;
}
export interface Dispatch {
<T extends keyof Actions>(type: T, payload?: GetPayLoad<Actions, T>, options?: DispatchOptions): Promise<GetReturnType<Actions, T>>;
}
}
const store = new Vuex.Store<RootState>(vuexOptions);
TypeScript 4.1 类型模板字符串实现Vuex的store.commit和store.dispatch类型判断
FAQs
vuex typescript commit dispatch prompt
We found that vuex-typescript-commit-dispatch-prompt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.