Javascript isomorphic-fetch 和 fetch 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37936715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between isomorphic-fetch and fetch?
提问by Joshua Rajandiran
I've seen two different fetch here:
我在这里看到了两种不同的获取:
Can someone tell me the difference between the two?
谁能告诉我两者的区别?
PS: I've read the README.md but I still didn't get the difference. Last time I checked, Isomorphic means it has similar form or relation. It still doesn't make sense to me.
PS:我已经阅读了 README.md,但我仍然没有得到区别。上次我检查时,同构意味着它具有相似的形式或关系。这对我来说仍然没有意义。
回答by Sergey
FETCHis polyfill for browsers which don't have fetch function (caniuse.com/#search=fetch). It will add fetch function to your browser window object.
FETCH是没有 fetch 功能的浏览器的polyfill( caniuse.com/#search=fetch)。它将向您的浏览器窗口对象添加 fetch 功能。
While isomorphic-fetchis implementation of fetch for both node.js and browser, built on top of fetch polyfill.
虽然isomorphic-fetch是 node.js 和浏览器的 fetch实现,但构建在 fetch polyfill 之上。