simondevyoutube / Quick_3D_MMORPG

Absolutely 100% unsupported, and full of infuriating bugs.
MIT License
450 stars 172 forks source link

Why IIFE? #11

Open gamedevsam opened 3 years ago

gamedevsam commented 3 years ago

In your code you wrap all exported classes in an immediately invoked function expression. But you're also using ES Modules.

Why do this?

export const something = (() => {
    class Something {}
    return { Something: Something };
})();

Instead of this?

export class Something {}