Show HN: Write ajax requests with template literals 10 years ago
The second example could be more concise IMHO:
const twitter = {
register: function(opts){
return request({
url: '...',
method: 'POST',
...opts
});
}
}
const resp = await twitter.register({ body });
EDIT: made it even more concise! -- back to real work :/