Use Promises for REST JS clients
finnurthorisson opened this issue · 0 comments
finnurthorisson commented
serveRestJSClient!
uses the old JS callback method while modern JS prefers Promises. This can be added without breaking the existing API by returning a Promise and keeping the callbacks.
If this is fine I'd be willing to make a PR.
I'd also be interested in replacing the XHR spaghetti with fetch
. Both Promise
and fetch
have been supported for ~10 years and only lack support in IE (is this a problem?).