File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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) ;
You can’t perform that action at this time.
0 commit comments