smartlook / smartlook-client

Official Smartlook client for easy frontend integration.
https://smartlook.com
MIT License
28 stars 9 forks source link

refactor: global declaration #24

Closed mauriciord closed 2 years ago

mauriciord commented 2 years ago
Joozty commented 2 years ago

Hi @mauriciord 👋,

thanks for your contribution. Is there any reason for making these changes? We use const w = window as SmartlookWindow intentionally so it stays encapsulated. Your change will automatically attach smartlook to the window object and anyone with this package installed can access window.smartlook without their compiler complaining. Obviously, it is correct because window.smartlook exists but the typing is dangerous since it is any. We could maybe make a better interface but for the time being it was done that way. 🙂