import { Observable } from 'rxjs/Observable' ; import { ErrorObservable } from 'rxjs/observable/ErrorObservable' ; export function valid < T > ( condition , error ) { if ( ! condition ) { return Observable . throw ( error ) ; } return Observable . empty < T > ( ) . skip ( 1 ) ; }