Skip to content

Instantly share code, notes, and snippets.

@augustovictor
Created March 26, 2017 11:21
Show Gist options
  • Select an option

  • Save augustovictor/d979897c2ddcacbd8eec54a8d80a4e52 to your computer and use it in GitHub Desktop.

Select an option

Save augustovictor/d979897c2ddcacbd8eec54a8d80a4e52 to your computer and use it in GitHub Desktop.
// https://jsfiddle.net/pamadvmu/
function DataStream(solution, key) {
this.solution = solution;
this.key = key;
this.exec = function() {
return 'Executing ' + this.key;
}
}
// This allow us to create shared functions in an organized way
DataStream.prototype.toString = function() {
return `Solution: ${this.solution} Key: ${this.key}`;
};
var getQueue = new DataStream('sky_at_bko', 'sky_at_bko_ds_get_queue');
var getAllQueues = new DataStream('sky_at_bko', 'sky_at_bko_ds_get_all_queues');
console.log(getQueue.exec());
console.log(getAllQueues.exec());
console.log(getQueue.toString());
console.log(getAllQueues.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment