From 4f633a8492b369650ac3ccb99051ebcbe78c9bec Mon Sep 17 00:00:00 2001 From: mantou132 <709922234@qq.com> Date: Wed, 10 Jul 2024 01:53:58 +0800 Subject: [PATCH] feat: improve benchmark example --- packages/gem-examples/src/benchmark/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/gem-examples/src/benchmark/index.ts b/packages/gem-examples/src/benchmark/index.ts index d10b3d44..08a953aa 100644 --- a/packages/gem-examples/src/benchmark/index.ts +++ b/packages/gem-examples/src/benchmark/index.ts @@ -141,10 +141,14 @@ export class App extends GemElement { () => html``, )}
- ${this.#pixelsPosition.map((index) => { - const color = pixels.slice(index, index + 4) as unknown as RGBA; - return html``; - })} + ${repeat( + this.#pixelsPosition, + (_, i) => i, + (index) => { + const color = pixels.slice(index, index + 4) as unknown as RGBA; + return html``; + }, + )}
`; }