Skip to content

Instantly share code, notes, and snippets.

@webprogramozo
Forked from somahargitai/javascriptclass.js
Last active December 20, 2020 23:03
Show Gist options
  • Save webprogramozo/6d10f08ef28ec56c63ee873a2ec0b2c9 to your computer and use it in GitHub Desktop.
Save webprogramozo/6d10f08ef28ec56c63ee873a2ec0b2c9 to your computer and use it in GitHub Desktop.
Read this.baseURL
const async = require('async');
class demoClass {
constructor(con) {
this.constantVariable = con;
const that = this;
this.q = async.queue(function(input, cb){
that.processFunc(input, cb);
//vagy that.processFunc.apply(that, arguments);
}, 1);
}
feedfunc(inputArray) {
for (const input of inputArray) {
this.q.push(input);
}
}
processFunc(input, cb) {
console.log(input);
console.log(this.constantVariable);
cb();
}
}
const demo = new demoClass('inputtext');
demo.feedfunc([
'a',
'b',
'c'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment