Last active
January 20, 2019 01:28
-
-
Save arackaf/c52012c9a534657c97e0bc1fe1b7695f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| workbox.routing.registerRoute( | |
| /graphql$/, | |
| ({ url, event }) => { | |
| let request = event.request.clone(); | |
| return fetch(event.request).then(response => { | |
| let respClone = response.clone(); | |
| respClone.json().then(response => { | |
| syncResultsFor({ request, response }, "Book", bookSyncTransform); | |
| syncResultsFor({ request, response }, "Tag"); | |
| }); | |
| return response; | |
| }); | |
| }, | |
| "POST" | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment