Add erase function (#2641)

This commit is contained in:
Aya Morisawa
2018-09-07 00:02:55 +09:00
committed by syuilo
parent 3cace734c7
commit 00d79487cd
11 changed files with 31 additions and 19 deletions

View File

@@ -3,6 +3,7 @@
*/
import composeNotification from './common/scripts/compose-notification';
import { erase } from '../../prelude/array';
// キャッシュするリソース
const cachee = [
@@ -24,8 +25,7 @@ self.addEventListener('activate', ev => {
// Clean up old caches
ev.waitUntil(
caches.keys().then(keys => Promise.all(
keys
.filter(key => key != _VERSION_)
erase(_VERSION_, keys)
.map(key => caches.delete(key))
))
);