Options
All
  • Public
  • Public/Protected
  • All
Menu

运行在 ServiceWorker 线程中的远程控制插件

Hierarchy

  • RemoteControllerBase
    • RemoteControllerSW

Implements

  • ServiceWorkerPlugin

Index

Constructors

Properties

configBackup: string
context: UseContext
fetchConfigThrottle: () => Promise<RemoteConfig>

Type declaration

name: "@glacierjs/plugin-remote-controller" = PLUGIN_NAME
options: Options = ...

Methods

  • getConfig(): Promise<{ config: RemoteConfig; configUpdated: boolean }>
  • onFetch(): Promise<void>
  • 在资源请求时,检查远程控制配置,并针对配置进行以下处理:

    1. 开关关闭时,进行 ServiceWorker 卸载
    2. 路由更新时,调用 资源缓存插件(AssetsCache)更新路由。

    Returns Promise<void>

  • onInstall(): Promise<void>
  • onUse(context: UseContext): void

Generated using TypeDoc