When there is no addEventListener on windows (might happen with server side rendering running in node), this lib throws an exception. This PR adds a check if addEventListener is available.
But, it would even be better if no code would be run when the lib is just imported, but rather it is actively used. Then this check would not be necessary.
When there is no addEventListener on windows (might happen with server side rendering running in node), this lib throws an exception. This PR adds a check if
addEventListener
is available.But, it would even be better if no code would be run when the lib is just imported, but rather it is actively used. Then this check would not be necessary.