Better HN
topnewbestaskshowjobs
Log inSign up

meh321

1 karma · joined Dec 23, 2016 (9y ago) · 1 submissions

Submissions

comment 9y ago · link · parent

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 :/