useAppUpdate

tcmts.react.useAppUpdate · #xzv5oj6y · term · runs in the browser

uses tcmts.react.router, which uses tcmts.react.createRouter, which uses IntersectionObserver

Whether a new version of the app is ready: a PWA's service worker took the new build in (reload loads it now). Always false for an app that isn't a PWA, and until the page is hydrated.

import { router } from "#codebase/tcmts/react";

export const useAppUpdate = (): { ready: boolean; reload(): void } => router.useAppUpdate()

uses