fetch-intercept
fetch-intercept copied to clipboard
Interceptor library for the native fetch command inspired by angular http intercepts.
Hey, I was wondering if there are any recommended ways to unit test fetch interceptors. I have tried using fetch-mock to mock a http request however that package doesn't allow...
Request intercept Interface looks like this:: ``` request?(url: string, config: any): Promise | any[];``` Based on looking at the code , the library invoked intercept's request api with the exact...
I'm trying to use this as part of a webpack-based web UI. I installed it with `npm install --save-dev fetch-intercept`. My code looks like: ``` js import fetchIntercept from 'fetch-intercept';...
Fetch -intercept depends on whatwg-fetch, but in dependencies there is no whatwg-fetch, and this will be an error if the user does not have whatwg-fetch locally "* whatwg-fetch in ./node_modules/fetch-intercept/lib/browser.js...
Hi, I am using typescript with React Native and node. I need to add an interceptor to check for reachability by verifying whether the device has a network connection. How...
The `fetch` function can be called either with a string url or `Request` object. If it's a `Request`, then it won't be handled properly now.
According to that issue https://github.com/werk85/fetch-intercept/issues/6, I've moved whatwg-fetch from devDependencies to dependencies
If you can make an automatic unregister interceptor, it will be perfect.
This happens when I specify the `requestError` function. Tested it in a new create-react-app with https://github.com/github/fetch. ``` import fetchIntercept from 'fetch-intercept'; const unregister = fetchIntercept.register({ requestError: (error) => { return...
I'm writing a hook on fetch response. I need both the URL and the method of the request to decide whether the hook should be called or not. However, in...