jfroelich / rss-reader

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

Consider revising fetch-image-element as fetch-image-dimensions #763

Open jfroelich opened 5 years ago

jfroelich commented 5 years ago

There are no current use cases that rely on the element itself. All use cases use this function just to get the image's dimensions. I am unsure about the idea, but basically, if there is only the more specific use case, then the module should be specialized toward that one specific use case instead of the more general use case. That use case is just getting dimensions, so instead of returning an image element, consider returning a basic dimensions object (e.g. w and h props).