Class constructors being invoked and then dropped immediately is an anti-pattern and should be avoided.
Objects instantiated with new
should always be useful in some way (passed as a function argument, stored in a variable for later use, etc).
If the object is instantiated only to invoke some side effect in the constructor, then the side effect should be refactored out into it's own function.
new Foo()
const myFoo = new Foo()