Add erase function (#2641)
This commit is contained in:
parent
3cace734c7
commit
00d79487cd
11 changed files with 31 additions and 19 deletions
|
|
@ -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))
|
||||
))
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue