pub fn use_service_worker() -> UseServiceWorkerReturn<impl Fn() + Clone + Send + Sync, impl Fn() + Clone + Send + Sync>
Expand description
Reactive ServiceWorker API.
Please check the working example.
§Usage
let UseServiceWorkerReturn {
registration,
installing,
waiting,
active,
skip_waiting,
check_for_update,
} = use_service_worker_with_options(UseServiceWorkerOptions::default()
.script_url("service-worker.js")
.skip_waiting_message("skipWaiting"),
);
§SendWrapped Return
The returned closures check_for_update
and skip_waiting
are sendwrapped functions. They can
only be called from the same thread that called use_service_worker
.
§Server-Side Rendering
This function does not support SSR. Call it inside a create_effect
.