Open tracker1 opened 5 years ago
Edited example code to return the promise chain, can be awaited outside this module as the result is a promise. Also sanity check for Promise and fetch... really only needed for IE support.
Can update webpack to not use babel at all.
Thanks for this! I have to dig around some more, but I now have a branch where I'm working on this.
Also, feel free to submit a PR if you get this working universally before I get to it.
Most modern browsers support async, and have fetch. It would be better to convert to commonjs imports, without the use of corejs, regenerator, axios, and crypto. The bundle size is likely really huge here.
For the sha1, can use https://www.npmjs.com/package/sha1 since Edge doesn't support SHA1 via SubtleCrypto.
For IE: would need to shim/polyfill Promises, and Fetch