A small wrapper around global fetch and node-fetch
:
-
In React Native, global
fetch
is used without importingnode-fetch
-
In Browser, global
fetch
is used without importingnode-fetch
-
Otherwise
node-fetch
is imported, but whenwindow.fetch
is present (e.g. in Electronrenderer
process), it is used. -
Otherwise (e.g. in Electron
browser
process and Node.js),node-fetch
is used.