Skip to content

Commit

Permalink
Update es-toolkit, bring back options
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Sep 29, 2024
1 parent 219b006 commit e0cbe03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"cli-cursor": "^4.0.0",
"cli-truncate": "^4.0.0",
"code-excerpt": "^4.0.0",
"es-toolkit": "^1.19.0",
"es-toolkit": "^1.22.0",
"indent-string": "^5.0.0",
"is-in-ci": "^0.1.0",
"patch-console": "^2.0.0",
Expand Down
10 changes: 8 additions & 2 deletions src/ink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ export default class Ink {

this.rootNode.onRender = options.debug
? this.onRender
: throttle(this.onRender, 32);
: throttle(this.onRender, 32, {
leading: true,
trailing: true,
});

this.rootNode.onImmediateRender = this.onRender;
this.log = logUpdate.create(options.stdout);
this.throttledLog = options.debug
? this.log
: throttle(this.log, undefined);
: throttle(this.log, undefined, {
leading: true,
trailing: true,
});

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

0 comments on commit e0cbe03

Please sign in to comment.