This file contains 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
self.addEventListener('install', (e) => { | |
e.waitUntil( | |
caches.open("precache").then((cache) => cache.add("/broken.png")) | |
); | |
}); | |
function isImage(fetchRequest) { | |
return fetchRequest.method === "GET" && fetchRequest.destination === "image"; | |
} |
This file contains 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
{ | |
// 继承,可以继承多个 | |
// 如安装了 eslint-config-airbnb | |
// 就可以在 extends 这里引用 airbnb/base, 这样就相当于预设了 airbnb/base 的规则 | |
// 常用的预设:"eslint:recommended" "airbnb/base" "stanard"(需先安装 eslint-config-standard) | |
// 当然,除了 eslint-config-xxx 提供了一系列预设,插件(eslint-plugin-xxx)也能提供预设用于继承 | |
// 例如,当你安装了 eslint-plugin-react 时,就可以在 extends 这里指定 "plugin:react/recommended" | |
// 当然,也可以指定一个具体的 eslint 配置文件 path/to/file 继承 | |
"extends": [ | |
"airbnb/base" |