vibe-d / vibe.d

Official vibe.d development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Promises for REST JS clients

finnurthorisson opened this issue · comments

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?).