-
-
Save nrjpoddar/f3010d1303774df0a7f42bad56fcadd0 to your computer and use it in GitHub Desktop.
Sample code for updated transformer module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const client = require('client'); | |
class Transformer { | |
constructor(name) { | |
this._name = name; | |
this._client = client.create(); | |
this._client.on('error', (e) => { | |
throw new Error(e.message); | |
}); | |
} | |
put(msg) { | |
msg += 'Hello from ' + this._name; | |
this._client.put(msg); | |
} | |
} | |
function create(name) { | |
return new Transformer(name); | |
} | |
module.exports.create = create; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment