werk85 / Fetch Intercept
Licence: mit
Interceptor library for the native fetch command inspired by angular http intercepts.
Stars: ✭ 279
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Fetch Intercept
node-fetch-cookies
node-fetch wrapper that adds support for cookie-jars
Stars: ✭ 15 (-94.62%)
Mutual labels: fetch
fastfetch
Like neofetch, but much faster because written in c. Only Linux.
Stars: ✭ 191 (-31.54%)
Mutual labels: fetch
Aspect4Delphi
Concepts of aspect-oriented programming (AOP) in Delphi.
Stars: ✭ 28 (-89.96%)
Mutual labels: interceptor
kras
Efficient server proxying and mocking in Node.js. 💪
Stars: ✭ 18 (-93.55%)
Mutual labels: interceptor
Abortcontroller Polyfill
Polyfill for the AbortController DOM API and abortable fetch (stub that calls catch, doesn't actually abort request).
Stars: ✭ 273 (-2.15%)
Mutual labels: fetch
meros
🪢 A fast utility that makes reading multipart responses simple
Stars: ✭ 109 (-60.93%)
Mutual labels: fetch
electron-request
Zero-dependency, Lightweight HTTP request client for Electron or Node.js
Stars: ✭ 45 (-83.87%)
Mutual labels: fetch
RetryRequestInterceptor-for-OkHttp
a interceptor for OkHttp which can save failed request in storage and will retry request until success or retry times over limit , or request live time over limit
Stars: ✭ 42 (-84.95%)
Mutual labels: interceptor
swr-examples
SWR is a React Hook library for remote data fetching. Here are some simple examples.
Stars: ✭ 14 (-94.98%)
Mutual labels: fetch
redux-things
Redux things | Fast and easy data synchronization for Redux
Stars: ✭ 12 (-95.7%)
Mutual labels: fetch
Turbo
A lightweight microservice tool, turn your grpc|thrift APIs into HTTP APIs!
Stars: ✭ 275 (-1.43%)
Mutual labels: interceptor
fetch-intercept
Interceptor library for the native fetch command inspired by angular http interceptors.
fetch-intercept
monkey patches the global fetch
method and allows you the usage in Browser, Node and Webworker environments.
Installation
npm install fetch-intercept --save
Usage
Note: You need to require fetch-intercept
before you use fetch
the first time.
Make sure you have a fetch
compatible environment or added a appropriate polyfill.
import fetchIntercept from 'fetch-intercept';
const unregister = fetchIntercept.register({
request: function (url, config) {
// Modify the url or config here
return [url, config];
},
requestError: function (error) {
// Called when an error occured during another 'request' interceptor call
return Promise.reject(error);
},
response: function (response) {
// Modify the reponse object
return response;
},
responseError: function (error) {
// Handle an fetch error
return Promise.reject(error);
}
});
// Call fetch to see your interceptors in action.
fetch('http://google.com');
// Unregister your interceptor
unregister();
React-Native Compatibility
Support react-native 0.17
or higher versions.
License
MIT
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].