-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do we handle listeners in Workbox #913
Comments
I've been starting to migrate the template used by It feels pretty good to have, e.g., I'm open to re-adding optional helper methods to the |
There are a few issues going on here, so let me try to summarize how I see things to make sure we're all on the same page: The concern of mine that originally brought up this discussion was not about event listeners, it was that a method was removed without any public issue tracking it. But @jeffposnick filed #914, so that's no longer a concern. On the subject of how to handle adding event listeners, I think that's actually two separate (and orthogonal) issues.
Re: (1) I think we should handle it on a case-by-case basis since not all event listeners are conceptually the same and not all classes offer the same types of functionality. To generically say that classes should never add event listeners seems a bit heavy-handed to me. In general though, I think we should err on the side of giving developers more control rather than giving them more magic. Re: (2) I'm almost never in favor of modules having any side effect just from being imported, especially not the default export of the package (since you get that no matter what). Having side-effects at import time has two big downsides form my perspective:
For example, if a user only wants workbox only for |
I think we are happy with this and see if developers request helpers. |
#721
What do people think is best?
cc @philipwalton @addyosmani @jeffposnick
The text was updated successfully, but these errors were encountered: