Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why a class? #62

Open
thany opened this issue Nov 18, 2021 · 0 comments
Open

Why a class? #62

thany opened this issue Nov 18, 2021 · 0 comments

Comments

@thany
Copy link

thany commented Nov 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant