better fix for the worker doctype

use the queue's doctype if one is not provided. also adds the option to the readme
This commit is contained in:
2017-05-23 18:04:01 -07:00
parent d4f24182b4
commit 32fb6a92f5
3 changed files with 3 additions and 5 deletions

View File

@@ -54,10 +54,7 @@ export default class Esqueue extends events.EventEmitter {
}
registerWorker(type, workerFn, opts) {
const options = Object.assign({
doctype: this.settings.doctype,
}, opts);
const worker = new Worker(this, type, workerFn, options);
const worker = new Worker(this, type, workerFn, opts);
this._workers.push(worker);
return worker;
}