Skip to content
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

It's a bug in the partial code for step 6 #2

Open
tjoskar opened this issue Mar 18, 2017 · 1 comment
Open

It's a bug in the partial code for step 6 #2

tjoskar opened this issue Mar 18, 2017 · 1 comment

Comments

@tjoskar
Copy link
Owner

tjoskar commented Mar 18, 2017

It should be:

const refreshResponse = cacheResponse
    .then(response => {
        if (response) {
            // If we have cached version of the request, we should update it and inform the user
            return updatedResponse;
        }
    })
    .then(response => {
        if (response) {
            // `response` is the fetch response here
            // We should inform the user somehow here.
        }
    });
event.waitUntil(refreshResponse);

Also, take the opportunity to clarify the code.

@tjoskar
Copy link
Owner Author

tjoskar commented Mar 18, 2017

To get step 6 to work the user must also name the api cache to api-cache-v1. try to use the global match instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant