Skip to content

Instantly share code, notes, and snippets.

@nrjpoddar
Last active March 17, 2017 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrjpoddar/f3010d1303774df0a7f42bad56fcadd0 to your computer and use it in GitHub Desktop.
Save nrjpoddar/f3010d1303774df0a7f42bad56fcadd0 to your computer and use it in GitHub Desktop.
Sample code for updated transformer module
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