Skip to content

Instantly share code, notes, and snippets.

@przemyslawjanpietrzak
Created November 1, 2021 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przemyslawjanpietrzak/a7d824ff276bce35c018f343dcd6623d to your computer and use it in GitHub Desktop.
Save przemyslawjanpietrzak/a7d824ff276bce35c018f343dcd6623d to your computer and use it in GitHub Desktop.
literal-types-vuex.ts
type Module1ActionContext = {
...
dispatch<K extends keyof Module2Actions>(
actionType: `module2Namespace/${keyof Module2Actions}`,
payload?: Parameters<Module2Actions[K]>[1],
options?: DispatchOptions,
): Promise<void> | void;
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment