import { Logger } from 'kibana/server' ; import { Stream } from 'stream' ; import { Observable } from 'rxjs' ; import { createCompressedStream } from './create_compressed_stream' ; import { createNDJSONStream } from './create_ndjson_stream' ; export function createStream < Payload , Response > ( response$ , logger , compress ) { return compress ? createCompressedStream ( response$ , logger ) : createNDJSONStream ( response$ , logger ) ; }