3 ms·
The second example could be more concise IMHO: const twitter = { register: function(opts){ return request({ url: '...', m
by meh321 10y 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 :/
- zackify 10y agoSure, keep adding many methods and make new functions every time. I totally get what you're saying. I just like the syntactic sugar of Template Literals :)