test.ts 277 B

12345678910111213
  1. import { Subject } from "rxjs";
  2. let testSubject: Subject<any> = new Subject()
  3. testSubject.next({test: 'See how long this take'})
  4. setTimeout(() => {
  5. testSubject.subscribe(e => console.log(e.test))
  6. }, 2000)
  7. setTimeout(() => {
  8. testSubject.next({test: 'too late'})
  9. }, 4000)