Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 310 Bytes

pathname$.md

File metadata and controls

14 lines (10 loc) · 310 Bytes

pathname$

ReadonlyBehaviorSubject that tracks emits on changes in pathname property of window.location. Is stubbed to also work on sever.

import { pathname$ } from 'rx-use';

pathname$.getValue(); // /my/path

pathname$.subscribe((pathname) => {
  console.log(pathname); // /my/path2
});