Closed szepeviktor closed 7 years ago
I can't say I know enough about AMD to be able to make a judgement call on this. I think I followed one of the UMD patterns, by the looks of it this one: https://github.com/umdjs/umd/blob/master/amdWebGlobal.js
There was a lot of discussion in issue #61
What I was asking for it this: https://github.com/umdjs/umd/blob/master/amdWeb.js When AMD loaded it does not pollute the global namespace.
Thanks for getting back to me :)
I don't know whether it is a good idea to drop the global once it has been out in the wild? People may be relying on it, and removing from global may cause them issues.
Is it causing you issues, or is it a suggestion just for best practice?
Reopening as it's worth discussing further...
"best practice" and for "not to write js lib that pollutes global namespace"
I am now using browserify to generate the UMD wrapper, so it should no longer pollute the global namespace. And as I wrote that, I just realised means that I've introduced a breaking change on a patch release... Ah well
Thank you for your work!
Could you please return only MediaQueryDispatch and not set window.enquire in AMD mode: https://github.com/WickyNilliams/enquire.js/blob/master/dist/enquire.js#L15
return (context[name] = factory(matchMedia));
would bereturn (factory(matchMedia));
Is it OK?