Export fetch function
See original GitHub issueExporting the fetch function through module.exports would allow me to use the polyfill instead of buggy browser implementations. For example, current Chrome Canary incorrectly throws on 504 response, without any sensible way of detecting the cause of error in the catch handler.
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Export data returned by 'fetch' from a separate .js file in React
The best way is export getData function, remove .then(obj => data ... const getData = async () => fetch("https://api.myjson.com/bins/mp441") ...
Read more >How to export fetch resuts to other module - JavaScript
I do so with this function: let user = {}; export async function getId() { const response = await fetch( "https://nomoreparties.co/v1/" + `${ ......
Read more >Four Ways to Fetch Data in React - Cory House
Fetch data from REST APIs in React. React is a focused component library. ... export function getUsers() { return fetch(`${process.env.
Read more >JavaScript modules - MDN Web Docs
The first thing you do to get access to module features is export them. This is done using the export statement. ... You...
Read more >Fetch Data in Next.js - Documentation - Prismic
Queries are performed using a client created by the createClient() function exported from prismicio.js. Here's a complete example, querying a document of type ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

excitera me sir but what? im jusing tor o chrome
Skickat från min iPhone
8 aug. 2018 kl. 09:19 skrev Jarek Rencz <notifications@github.commailto:notifications@github.com>:
@mislavhttps://github.com/mislav thanks for a hint 😃
Any faulty browser implementation of fetch is that browser vendor’s problem and should be taken with them.
To a certain extent it’s not always on the browser vendor’s side. E.g.: In a project of mine, where I use fetchI experience a strange behaviour in Firefox <54 where using native fetch it produces POST requests without payload. I was able to reproduce it with 1/500-1000 ratio but I see it in production so it’s a fact.
Enforcing polyfill allows me to make my app usable for such users (those are mostly Firefox 52 users)
And now to the point: Firefox 52 is the last one on Win XP and Win Vista. I don’t have a comfort of telling my users to update their PCs’ OS just because at some point Mozilla did something bad in fetch implementation and then they fixed it (to my best knowledge either silently or accidentally because I found no bug report about such behaviour in Bugzilla)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/github/fetch/issues/180#issuecomment-411311099, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AoPVRO_Qst3Il-tU9tCvRCIkVLxcnGCDks5uOpD2gaJpZM4Fblbf.
@jpochyla Here is how to force the polyfill.
@runn1ng We don’t feel that a module pattern is worth maintaining for this simple polyfill. Any faulty browser implementation of
fetchis that browser vendor’s problem and should be taken with them.