Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 388 Bytes

connection$.md

File metadata and controls

23 lines (19 loc) · 388 Bytes

connection$

ReadonlyBehaviorSubject that changes in window.navigator.connection object. Is stubbed to also work on sever.

import { connection$ } from 'rx-use/lib/connection$';

connection$.getValue();
/*
{
  downlink?: number;
  downlinkMax?: number;
  effectiveType?: string;
  rtt?: number;
  type?: string;
}
*/

connection$.subscribe((connection) => {
  // ..
});