Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Separate pure and side-effecting code #195

Merged
merged 1 commit into from Oct 6, 2016

Conversation

samertm
Copy link
Contributor

@samertm samertm commented Sep 28, 2016

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
Copy link

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).

📝 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.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@samertm
Copy link
Contributor Author

samertm commented Sep 29, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

precache: precache
cache: helpers.cache,
uncache: helpers.uncache,
precache: helpers.precache
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cleans up the main sw-toolbox entry quite a bit while making it easier to just pull in the helpers. It's also passing our current CI tests. I'm personally fine with this change, but let's see what @jeffposnick and @gauntface think.

Copy link
Contributor

@wibblymat wibblymat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A wild @wibblymat appears!

I agree that this change makes sense for people who want to use the helpers on their own.

@jeffposnick
Copy link
Contributor

👍 from my perspective as well.

As an FYI, we're thinking about similar topics in GoogleChrome/workbox#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
Copy link
Contributor Author

samertm commented Sep 30, 2016

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

@samertm
Copy link
Contributor Author

samertm commented Oct 4, 2016

Friendly ping to merge this in. :)

@addyosmani addyosmani merged commit f31cc6b into GoogleChromeLabs:master Oct 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants