GoogleChromeLabs / sw-toolbox

[Deprecated] A collection of service worker tools for offlining runtime requests
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
Apache License 2.0
3.62k stars 331 forks source link

Separate pure and side-effecting code #195

Closed samertm closed 7 years ago

samertm commented 8 years ago

To make it easier to use sw-toolbox as a library, this PR moves all the helper and listener functions out of sw-toolbox.js so they can be imported without setting up the event listeners.

Tests in Chrome 51 pass locally.

googlebot commented 8 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


samertm commented 8 years ago

I signed it!

googlebot commented 8 years ago

CLAs look good, thanks!

jeffposnick commented 8 years ago

👍 from my perspective as well.

As an FYI, we're thinking about similar topics in https://github.com/GoogleChrome/sw-helpers/issues/44

I see this PR a move in that direction using the current codebase, which should be continue to be relevant for a while yet. But if you have any feedback about the proposals tracked in that issue, that would end up being the most meaningful longer term.

samertm commented 8 years ago

Thanks! I'll take a look at that issue.

samertm commented 8 years ago

Friendly ping to merge this in. :)