Closed cedricguillas closed 1 year ago
The reason for not merging this PR is to keep the library compatible out of the box with other frameworks like Nativescript. I remember fetch not working there. Axios is more compatible in my experience than fetch.
We can probably look for other alternatives.
You can now add custom adapters to axios through a config option. This makes it possible to use fetch. Updated readme with the following example:
You can define a different adapter if your environment doesn't support 'xhr' or 'http' See https://github.com/haverstack/axios-fetch-adapter Example:
import fetchAdapter from '@haverstack/axios-fetch-adapter' hiveTx.config.axiosAdapter = fetchAdapter
Replaced axios by node-fetch to make sure HiveTx is compatible with extensions service workers