Skip to content

Commit ec22895

Browse files
committed
Remove types for modifier registration functions
These have been removed and can't be imported anymore.
1 parent 84c4644 commit ec22895

File tree

2 files changed

+2
-65
lines changed

2 files changed

+2
-65
lines changed

packages/ember-concurrency/src/index.d.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -611,58 +611,6 @@ export type AsyncTaskFunction<T, Args extends any[]> = (
611611
...args: Args
612612
) => Promise<T>;
613613

614-
/**
615-
* Creates a task with the `drop` modifier applied.
616-
*/
617-
export function dropTask<
618-
HostObject,
619-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
620-
>(asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
621-
export function dropTask<
622-
HostObject,
623-
O extends TaskOptions,
624-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
625-
>(baseOptions: O, asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
626-
627-
/**
628-
* Creates a task with the `enqueue` modifier applied.
629-
*/
630-
export function enqueueTask<
631-
HostObject,
632-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
633-
>(asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
634-
export function enqueueTask<
635-
HostObject,
636-
O extends TaskOptions,
637-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
638-
>(baseOptions: O, asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
639-
640-
/**
641-
* Creates a task with the `keepLatest` modifier applied.
642-
*/
643-
export function keepLatestTask<
644-
HostObject,
645-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
646-
>(asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
647-
export function keepLatestTask<
648-
HostObject,
649-
O extends TaskOptions,
650-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
651-
>(baseOptions: O, asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
652-
653-
/**
654-
* Creates a task with the `restartable` modifier applied.
655-
*/
656-
export function restartableTask<
657-
HostObject,
658-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
659-
>(asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
660-
export function restartableTask<
661-
HostObject,
662-
O extends TaskOptions,
663-
T extends AsyncArrowTaskFunction<HostObject, any, any[]>,
664-
>(baseOptions: O, asyncArrowTaskFn: T): TaskForAsyncTaskFunction<HostObject, T>;
665-
666614
/**
667615
* A cancelation-aware variant of [Promise.all](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).
668616
* The normal version of a `Promise.all` just returns a regular, uncancelable

packages/test-app/types-tests/ember-concurrency-test.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,14 @@ import {
1717
allSettled,
1818
animationFrame,
1919
didCancel,
20-
dropTask,
21-
enqueueTask,
2220
forever,
2321
getModifier,
2422
hasModifier,
2523
hash,
2624
hashSettled,
27-
keepLatestTask,
2825
race,
2926
rawTimeout,
3027
registerModifier,
31-
restartableTask,
3228
task,
3329
timeout,
3430
waitForEvent,
@@ -1608,7 +1604,8 @@ module('integration tests', () => {
16081604
test('classic ember', () => {
16091605
ClassicComponent.extend({
16101606
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
1611-
myTask: restartableTask(
1607+
myTask: task(
1608+
{ restartable: true },
16121609
async (immediately: boolean, ms: number = 500) => {
16131610
if (!immediately) {
16141611
await timeout(ms);
@@ -1939,14 +1936,6 @@ module('integration tests', () => {
19391936
return 'wow';
19401937
});
19411938

1942-
restartable = restartableTask(async () => {});
1943-
restartable2 = restartableTask({ maxConcurrency: 2 }, async () => {});
1944-
enqueue = enqueueTask(async () => {});
1945-
enqueue2 = enqueueTask({ maxConcurrency: 2 }, async () => {});
1946-
drop = dropTask(async () => {});
1947-
drop2 = dropTask({ maxConcurrency: 2 }, async () => {});
1948-
keepLatest = keepLatestTask(async () => {});
1949-
keepLatest2 = keepLatestTask({ maxConcurrency: 2 }, async () => {});
19501939
debug = task({ debug: true }, async () => {});
19511940
onState = task({ onState: () => {} }, async () => {});
19521941
onStateNull = task({ onState: null }, async () => {});

0 commit comments

Comments
 (0)