Skip to content

Instantly share code, notes, and snippets.

@somahargitai
Last active December 20, 2020 22:39
Show Gist options
  • Save somahargitai/653500ddafdaa601ded6cb5e59e44d10 to your computer and use it in GitHub Desktop.
Save somahargitai/653500ddafdaa601ded6cb5e59e44d10 to your computer and use it in GitHub Desktop.
Read this.baseURL
const async = require('async');
class demoClass {
constructor(con) {
this.constantVariable = con;
this.q = async.queue(this.processFunc, 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