Skip to content

Instantly share code, notes, and snippets.

View ankitbtanna's full-sized avatar
💭
Making Videos on Youtube.com/EverydayJavaScript

Ankit Tanna ankitbtanna

💭
Making Videos on Youtube.com/EverydayJavaScript
View GitHub Profile
@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()