jfroelich / rss-reader

A simple Chrome extension for viewing RSS feeds
Other
10 stars 0 forks source link

Rename better-fetch to fetch #813

Closed jfroelich closed 5 years ago

jfroelich commented 5 years ago

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.

jfroelich commented 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.

jfroelich commented 5 years ago

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.