Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store resolve() calls and full responses #5

Open
jeffturcotte opened this issue Nov 29, 2017 · 0 comments
Open

Store resolve() calls and full responses #5

jeffturcotte opened this issue Nov 29, 2017 · 0 comments

Comments

@jeffturcotte
Copy link
Member

The store's actions should probably not pass the full axios response to the subsequent promise then() handlers. At that point HTTP doesn't really matter and should be abstracted out. This way the components that are actually calling these actions are dealing solely with the returned json.

Using response.data.data.whatever within a component feels wrong.

resolve(response)

// should be

resolve(response.data)

// if you *really* wanted access to the full response, this could work...

resolve(response.data, response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant