onurzorluer / react-image-file-resizer

Resize Local Images with React 🌄 🌅
MIT License
313 stars 41 forks source link

Why a class? #62

Open thany opened 2 years ago

thany commented 2 years ago

The source is written to be a class, and then an export is created, which is just a plain function calling a static function inside that class.

The whole source could be a collection of plain functions, and looking at the export, you could export the main resize function as-is. Currently, you're wrapping it in a function with an otherwise identical signature, which is unneccesary overhead.

In short:

  1. No need for it to be a class
  2. No need for a wrapper export function

This will make for a cleaner source, and smaller package size.