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