Skip to content

Commit 8583461

Browse files
committed
remove deprecated deferOnce, defer and setTimeout
1 parent 838c462 commit 8583461

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

lib/index.ts

+2-27
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ export default class Backburner {
122122
@return instantiated class DeferredActionQueues
123123
*/
124124
public begin(): DeferredActionQueues {
125-
let options = this.options;
126125
let previousInstance = this.currentInstance;
127126
let current;
128127

@@ -133,7 +132,7 @@ export default class Backburner {
133132
if (previousInstance !== null) {
134133
this.instanceStack.push(previousInstance);
135134
}
136-
current = this.currentInstance = new DeferredActionQueues(this.queueNames, options);
135+
current = this.currentInstance = new DeferredActionQueues(this.queueNames, this.options);
137136
this._trigger('begin', current, previousInstance);
138137
}
139138

@@ -236,14 +235,6 @@ export default class Backburner {
236235
return this._join(target, method, args);
237236
}
238237

239-
/**
240-
* @deprecated please use schedule instead.
241-
*/
242-
public defer(queueName: string, ...args);
243-
public defer() {
244-
return this.schedule(...arguments);
245-
}
246-
247238
/**
248239
* Schedule the passed function to run inside the specified queue.
249240
*/
@@ -270,14 +261,6 @@ export default class Backburner {
270261
return this._ensureInstance().schedule(queueName, null, iteratorDrain, [iterable], false, stack);
271262
}
272263

273-
/**
274-
* @deprecated please use scheduleOnce instead.
275-
*/
276-
public deferOnce(queueName: string, ...args);
277-
public deferOnce() {
278-
return this.scheduleOnce(...arguments);
279-
}
280-
281264
/**
282265
* Schedule the passed function to run once inside the specified queue.
283266
*/
@@ -291,14 +274,6 @@ export default class Backburner {
291274
return this._ensureInstance().schedule(queueName, target, method, args, true, stack);
292275
}
293276

294-
/**
295-
* @deprecated use later instead.
296-
*/
297-
public setTimeout(...args);
298-
public setTimeout() {
299-
return this.later(...arguments);
300-
}
301-
302277
public later()
303278
public later(...args) {
304279
let length = args.length;
@@ -489,7 +464,7 @@ export default class Backburner {
489464
return this._cancelItem(timer, this._throttlers) || this._cancelItem(timer, this._debouncees);
490465
} else if (timerType === 'function') { // we're cancelling a setTimeout
491466
return this._cancelLaterTimer(timer);
492-
} else if (timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce
467+
} else if (timerType === 'object' && timer.queue && timer.method) { // we're cancelling a scheduleOnce
493468
return timer.queue.cancel(timer);
494469
}
495470

tests/configurable-timeout-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ QUnit.test('We can use a custom setTimeout', function(assert) {
3939
}
4040
});
4141

42-
bb.setTimeout(() => {
42+
bb.later(() => {
4343
assert.ok(bb.options._platform.isFakePlatform, 'we are using the fake platform');
4444
assert.ok(customNextWasUsed , 'custom later was used');
4545
done();

tests/defer-once-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ QUnit.test('throws when passed an undefined method', function(assert) {
7676
onError
7777
});
7878

79-
bb.run(() => bb.deferOnce('deferErrors', {zomg: 'hi'}, undefined));
79+
bb.run(() => bb.scheduleOnce('deferErrors', {zomg: 'hi'}, undefined));
8080
});
8181

8282
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
9090
onError
9191
});
9292

93-
bb.run(() => bb.deferOnce('deferErrors', {zomg: 'hi'}, 'checkFunction'));
93+
bb.run(() => bb.scheduleOnce('deferErrors', {zomg: 'hi'}, 'checkFunction'));
9494
});
9595

9696
QUnit.test('when passed a target, method, and arguments', function(assert) {

0 commit comments

Comments
 (0)