Closed jfroelich closed 5 years ago
One solution is to use an anonymous default export:
export default function() {
return fetch(...);
}
This avoids any issue with the fetch identifier.
On the other hand, I am not replacing fetch. I am extending it. Naming the extended version the same as the original is a misnomer as it implies similar functionality.
The primary obstacle is redefining a builtin identifier within a module, combined with function hoisting. I do this in several other places through parameters but here it is in global module scope so I get a bit confused.