makeHeaders refactoring
snqb opened this issue · comments
Having to iterate over object to create Headers of them is obsolete.
Headers
constructor accepts a plain object and constructs Headers class instance of it.
const makeHeaders = obj => { let h = new Headers() for (let key in obj) { h.append(key, obj[key]) } return h }
becomes
const makeHeaders = obj => new Headers(obj)