nuxt / http

Universal HTTP Module for Nuxt.js
https://http.nuxtjs.org
MIT License
229 stars 51 forks source link

onResponse hook is not working #151

Closed lapwat closed 3 years ago

lapwat commented 3 years ago

This code is printing a Request object instead of a Response object.

// ~/plugins/http.js
export default function ({ $http, $toast }) {
  $http.onResponse(response => {
    console.log(response)
  })
}

Result

image

Gu3 commented 3 years ago

Yep, the doc is not correct : look the example and not the declaration https://http.nuxtjs.org/hooks#onresponse

atinux commented 3 years ago

@geminii do you mind taking a look at it?

Geminii commented 3 years ago

@Geminii do you mind taking a look at it?

Yes i will to check and correct it

Gu3 commented 3 years ago

I already made a PR about that : https://github.com/nuxt/http/pull/159 😉

atinux commented 3 years ago

So I guess we can close this :)

Geminii commented 3 years ago

I already made a PR about that : https://github.com/nuxt/http/pull/159 😉

Thanks about it 👍

lapwat commented 3 years ago

@Geminii @Atinux @Gu3 Thank you all for dealing with this issue!