Ben Lin
2024-08-28 0a8a3f71f2e50f0603077197d9b1971431a64b36
1
2
3
4
5
6
7
8
import { isBrowser } from './isBrowser';
 
export function isOnline(): boolean {
  if (isBrowser && typeof navigator.onLine !== 'undefined') {
    return navigator.onLine;
  }
  return true;
}