Skip to content

Commit d760f43

Browse files
committed
Replace ThrottledFunc with type assertion
1 parent e0cbe03 commit d760f43

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ink.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ export type Options = {
2727
waitUntilExit?: () => Promise<void>;
2828
};
2929

30-
type ThrottledFunc<T extends (...args: any[]) => void> = ReturnType<typeof throttle<T>>;
31-
3230
export default class Ink {
3331
private readonly options: Options;
3432
private readonly log: LogUpdate;
35-
private readonly throttledLog: LogUpdate | ThrottledFunc<LogUpdate>;
33+
private readonly throttledLog: LogUpdate;
3634
// Ignore last render after unmounting a tree to prevent empty output before exit
3735
private isUnmounted: boolean;
3836
private lastOutput: string;
@@ -66,7 +64,7 @@ export default class Ink {
6664
: throttle(this.log, undefined, {
6765
leading: true,
6866
trailing: true,
69-
});
67+
}) as unknown as LogUpdate;
7068

7169
// Ignore last render after unmounting a tree to prevent empty output before exit
7270
this.isUnmounted = false;

0 commit comments

Comments
 (0)