From e0cbe0337ce4e44a80e811f40b237d5dd3f54b92 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Sun, 29 Sep 2024 16:31:42 +0200 Subject: [PATCH] Update es-toolkit, bring back options --- package.json | 2 +- src/ink.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d027842a..1467e897 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ink.tsx b/src/ink.tsx index b3bc12d3..00abe1ae 100644 --- a/src/ink.tsx +++ b/src/ink.tsx @@ -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;