Skip to content

Instantly share code, notes, and snippets.

@ykyk1218
Last active June 8, 2018 00:31
Show Gist options
  • Select an option

  • Save ykyk1218/53523d355d75a7fee3fe0c4fbc84af96 to your computer and use it in GitHub Desktop.

Select an option

Save ykyk1218/53523d355d75a7fee3fe0c4fbc84af96 to your computer and use it in GitHub Desktop.
for seq in event.data["seq"]
console.log "Request: " + seq
fetch(new Request("/#{seq}", {mode: 'no-cors'})).then((response) ->
console.log "after Request: " + seq
caches.open(CACHE_NAME).then((cache) ->
cache.put("/#{seq}", response)
)
).catch((err) ->
console.error(err)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment