diff --git a/lib/index.ts b/lib/index.ts index 3c45ade8..faa35cb8 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -122,7 +122,6 @@ export default class Backburner { @return instantiated class DeferredActionQueues */ public begin(): DeferredActionQueues { - let options = this.options; let previousInstance = this.currentInstance; let current; @@ -133,7 +132,7 @@ export default class Backburner { if (previousInstance !== null) { this.instanceStack.push(previousInstance); } - current = this.currentInstance = new DeferredActionQueues(this.queueNames, options); + current = this.currentInstance = new DeferredActionQueues(this.queueNames, this.options); this._trigger('begin', current, previousInstance); } @@ -236,14 +235,6 @@ export default class Backburner { return this._join(target, method, args); } - /** - * @deprecated please use schedule instead. - */ - public defer(queueName: string, ...args); - public defer() { - return this.schedule(...arguments); - } - /** * Schedule the passed function to run inside the specified queue. */ @@ -270,14 +261,6 @@ export default class Backburner { return this._ensureInstance().schedule(queueName, null, iteratorDrain, [iterable], false, stack); } - /** - * @deprecated please use scheduleOnce instead. - */ - public deferOnce(queueName: string, ...args); - public deferOnce() { - return this.scheduleOnce(...arguments); - } - /** * Schedule the passed function to run once inside the specified queue. */ @@ -291,14 +274,6 @@ export default class Backburner { return this._ensureInstance().schedule(queueName, target, method, args, true, stack); } - /** - * @deprecated use later instead. - */ - public setTimeout(...args); - public setTimeout() { - return this.later(...arguments); - } - public later() public later(...args) { let length = args.length; @@ -489,7 +464,7 @@ export default class Backburner { return this._cancelItem(timer, this._throttlers) || this._cancelItem(timer, this._debouncees); } else if (timerType === 'function') { // we're cancelling a setTimeout return this._cancelLaterTimer(timer); - } else if (timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce + } else if (timerType === 'object' && timer.queue && timer.method) { // we're cancelling a scheduleOnce return timer.queue.cancel(timer); } diff --git a/tests/configurable-timeout-test.ts b/tests/configurable-timeout-test.ts index 452befb4..193d0f0c 100644 --- a/tests/configurable-timeout-test.ts +++ b/tests/configurable-timeout-test.ts @@ -39,7 +39,7 @@ QUnit.test('We can use a custom setTimeout', function(assert) { } }); - bb.setTimeout(() => { + bb.later(() => { assert.ok(bb.options._platform.isFakePlatform, 'we are using the fake platform'); assert.ok(customNextWasUsed , 'custom later was used'); done(); diff --git a/tests/defer-once-test.ts b/tests/defer-once-test.ts index 53e45048..69776898 100644 --- a/tests/defer-once-test.ts +++ b/tests/defer-once-test.ts @@ -76,7 +76,7 @@ QUnit.test('throws when passed an undefined method', function(assert) { onError }); - bb.run(() => bb.deferOnce('deferErrors', {zomg: 'hi'}, undefined)); + bb.run(() => bb.scheduleOnce('deferErrors', {zomg: 'hi'}, undefined)); }); QUnit.test('throws when passed an method name that does not exists on the target', function(assert) { @@ -90,7 +90,7 @@ QUnit.test('throws when passed an method name that does not exists on the target onError }); - bb.run(() => bb.deferOnce('deferErrors', {zomg: 'hi'}, 'checkFunction')); + bb.run(() => bb.scheduleOnce('deferErrors', {zomg: 'hi'}, 'checkFunction')); }); QUnit.test('when passed a target, method, and arguments', function(assert) {