Skip to content

dispatch errors should return a rejected promise and not undefined #850

@TomKaltz

Description

@TomKaltz

What problem does this feature solve?

When calling store.dispatch('nonExistentAction') the function returns with undefined. Should this instead return a rejected promise with the error?

What does the proposed API look like?

store.dispatch('nonExistentAction')
  .then((result)=>{ ... })
  .catch((e)=>{ ... })

If the action does not exist the catch handler will be called with an aptly named error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions