Skip to content

Instantly share code, notes, and snippets.

@sadick254
Created November 1, 2017 12:56
Show Gist options
  • Select an option

  • Save sadick254/3dc7c91fe9f22d8c54e6b577a3099aa6 to your computer and use it in GitHub Desktop.

Select an option

Save sadick254/3dc7c91fe9f22d8c54e6b577a3099aa6 to your computer and use it in GitHub Desktop.
export const get = ({commit}, {url = '', params = {}, type = '', canCommit = true}) => {
axios.get(url, {
params
}).then(resp => {
if (canCommit) {
commit(type, resp.data)
}
return resp.data
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment