import * as Rx from 'rxjs'; const subject = new Rx.Subject(); subject.subscribe(r => { console.log(r); }); subject.next('hello'); subject.next('goodbye'); subject.complete() subject.next('me again');