added gitlab ci
This commit is contained in:
23
ts/index.ts
Normal file
23
ts/index.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import * as plugins from './smartstream.plugins'
|
||||
|
||||
export interface IErrorFunction {
|
||||
(err): number
|
||||
}
|
||||
|
||||
export class Smartstream {
|
||||
streamArray = []
|
||||
errorFunction: IErrorFunction = null
|
||||
constructor(streamArrayArg: any[]){
|
||||
this.streamArray = streamArrayArg
|
||||
}
|
||||
onError(errorFunctionArg: IErrorFunction) {
|
||||
this.errorFunction = errorFunctionArg
|
||||
}
|
||||
run() {
|
||||
let combinedStream = plugins.streamCombiner2.obj(this.streamArray)
|
||||
if (this.errorFunction !== null) {
|
||||
combinedStream.on('error', this.errorFunction)
|
||||
}
|
||||
return combinedStream
|
||||
}
|
||||
}
|
3
ts/smartstream.plugins.ts
Normal file
3
ts/smartstream.plugins.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import 'typings-global'
|
||||
export import q = require('q')
|
||||
export let streamCombiner2 = require('stream-combiner2')
|
Reference in New Issue
Block a user