import { from , Observable } from 'rxjs' ; import { of } from 'rxjs' ; export abstract class Mapper < E , T > { abstract mapFrom ( source ) ; public observable ( source ) { if ( source instanceof Array ) { return from ( source . map ( this . mapFrom ) ) ; } else { return of ( this . mapFrom ( source ) ) ; } } }