I want to update the encoderStream method in MsgTransmitter to return some object in the callback. Is it possible to make it protected so that I can override it? Please check the pseudo code below:
export abstract class MsgTransmitter extends events.EventEmitter {
public send (msgType: string, obj: ILooseObject, callback: (error: Error, data: any) => void): void {
this.encodeStream.write(new MsgPayload(msgType, obj), callback);
}
...
private encoderStream (): Transform {
const transmitter = this
return new Transform({
writableObjectMode: true,
transform (payload: MsgPayload, encoding, done: Function) {
try {
...
const state = transmitter.encodeMessage(msgType, payload.obj)
...
done(undefined, state) <--- This is what I want to update
} catch (e) {
done(e)
}
}
})
}
}
Hi,
I want to update the encoderStream method in MsgTransmitter to return some object in the callback. Is it possible to make it protected so that I can override it? Please check the pseudo code below: