as @flavius29663 said (https://news.ycombinator.com/item?id=28593669) you can use the builder pattern
FetchBuilder()
.withUrl(ur)
.withMode("cors")
.withCache(true)
.withHeader('Content-Type', 'application/json')
.accept('*/*')
.post()
.then(response => response.json())
.then(data => console.log(data));