Periodically fetches / (index.html) to check if a new JavaScript bundle has been released.
/
index.html
If the bundle has been updated, the user is prompted to refresh the page. After 3 alerts are shown, the page is forcibly refreshed.
Don't enable this in development!
Your index.html must contain a script tag like:
<script src="app.23e590a23b49.js"></script>
or
<script src="dist/app.js?v=Gq0JHtehvL9fMpV"></script>
checkForJsBundleUpdateSaga will compare the src attribute of the script tag.
checkForJsBundleUpdateSaga
src
An example of using checkForJsBundleUpdateSaga from your TypeScript code:
export function* myCheckForJsBundleUpdateSaga(): SagaIterator<void> { if (process.env.NODE_ENV === 'development') return function onError(e: unknown): void { console.error(e) Bugsnag.notify(e) } yield call(checkForJsBundleUpdateSaga, { onError })}
Generated using TypeDoc
Periodically fetches
/
(index.html
) to check if a new JavaScript bundle has been released.If the bundle has been updated, the user is prompted to refresh the page. After 3 alerts are shown, the page is forcibly refreshed.
Don't enable this in development!
Your
index.html
must contain a script tag like:or
checkForJsBundleUpdateSaga
will compare thesrc
attribute of the script tag.An example of using
checkForJsBundleUpdateSaga
from your TypeScript code: