Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created September 19, 2022 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/e2459388d083d46564c6d3e44d7e9505 to your computer and use it in GitHub Desktop.
Save NetanelBasal/e2459388d083d46564c6d3e44d7e9505 to your computer and use it in GitHub Desktop.
export const OFFLINE_INIT = attachInitEffect(() => {
const toast = inject(ToastService);
const window = inject(WINDOW);
window.addEventListener('offline', () => {
toast.warning('There is no internet connection', {
duration: 10_000,
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment