Skip to content

Commit ffd956d

Browse files
committed
refactor: remove default value of onTypingDone
1 parent d61cb64 commit ffd956d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/TypistCore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class TypistCore {
1515
#pause!: boolean;
1616
#startDelay!: number;
1717
#finishDelay!: number;
18-
#onTypingDone!: () => void;
18+
#onTypingDone?: () => void;
1919
#splitter!: Splitter;
2020

2121
#clearTimer: () => void = emptyFunc;
@@ -43,7 +43,7 @@ export default class TypistCore {
4343
pause = false,
4444
startDelay = 0,
4545
finishDelay = 0,
46-
onTypingDone = emptyFunc,
46+
onTypingDone,
4747
splitter = defaultSplitter,
4848
}: CoreProps) => {
4949
this.#children = children;
@@ -72,7 +72,7 @@ export default class TypistCore {
7272
else if (type === 'PAUSE') await this.#timeoutPromise(payload);
7373
else if (type === 'PASTE') this.#updateTypedLines([...this.#typedLines, payload]);
7474
}
75-
this.#onTypingDone();
75+
this.#onTypingDone?.();
7676
await this.#timeoutPromise(this.#finishDelay);
7777
await this.#loopPromise();
7878
} while (this.#loop);

0 commit comments

Comments
 (0)