import { BehaviorSubject } from 'rxjs' ; /**
 * BehaviorSubject created with an initial value
 * and emits its latest value
 */ export function play ( ... args ) { const behaviorSubject = new BehaviorSubject ( 'Waiting for data' ) ; setTimeout ( ( ) => { behaviorSubject . next ( 'Got the data' ) ; behaviorSubject . next ( 'Got data again' ) ; } , 500 ) ; return behaviorSubject ; }