test.ts 279 B

1234567891011121314
  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)