-
-
Save ankitbtanna/da03355a1b0f3b2eeeaaa7cb01d447a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ providedIn: 'root' }) | |
export class OfflineService { | |
constructor(private toast: HotToastService) { | |
fromEvent(window, 'offline').pipe( | |
tap(() => | |
this.toast.warning('There is no internet connection', { | |
duration: 10_000, | |
}) | |
) | |
).subscribe() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment