Skip to main content

registerServiceWorker

Callable

  • registerServiceWorker<Client>(phpApi: Client, scope: string, scriptUrl: string): Promise<void>

  • Run this in the main application to register the service worker or reload the registered worker if the app expects a different version than the currently registered one.


    Type parameters

    • Client: Remote<PHPWorker>

    Parameters

    • phpApi: Client
    • scope: string
    • scriptUrl: string

      The URL of the service worker script.

    Returns Promise<void>