Skip to content

Typescript typed vuex #532

Closed
Closed
@ubershmekel

Description

@ubershmekel

Right now it's hard to maintain type safety with Vuex and Typescript because of the way the $store exposes actions and mutations through string-based dispatch and commit. At compile time there's no way to know the strings are valid or that the passed payload has the requisite fields.

There's this valiant effort:

Though that API doesn't really look like the Vuex API to me. Would there be interest in trying to allow typescript type safety in Vuex? Are there existing best practices?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or requesttypesRelated to typings only

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions