aribouius / jsonapi-react

A minimal JSON:API client and React hooks for fetching, updating, and caching remote data.
MIT License
149 stars 28 forks source link

Is there a way to intercept requests and responses? #38

Closed npearson72 closed 3 years ago

npearson72 commented 3 years ago

As the title says. Similar to how axios allows you interceptors.

aribouius commented 3 years ago

@npearson72 not at the moment, although it's something I'd love to build better support for.

While not advertised, the library does allow overriding the fetch method that is used to execute requests. This means you could provide a custom one that uses axios under the hood.

npearson72 commented 3 years ago

Thanks @aribouius