Skip to content

Commit

Permalink
remove deprecated deferOnce, defer and setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Dec 4, 2017
1 parent 838c462 commit 8583461
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
29 changes: 2 additions & 27 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}

Expand Down Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/configurable-timeout-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/defer-once-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 8583461

Please sign in to comment.