Skip to content

Commit

Permalink
Introduced BenchmarkResponse interface and updated fetch responses
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGL committed Sep 16, 2024
1 parent 7a393b8 commit 028019b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const NODE_VERSIONS = [22, 21, 20, 19, 18, 16];

const BUN_VERSIONS = [1];

interface BenchmarkResponse {
results: BenchmarkResult[];
}

interface BenchmarkResult {
name: string;
benchmark: string;
Expand Down Expand Up @@ -467,7 +471,7 @@ class App extends Component<
componentDidMount() {
NODE_VERSIONS.forEach((v, i) => {
fetch(`results/node-${v}.json`)
.then(response => response.json())
.then(response => response.json() as Promise<BenchmarkResponse>)
.then(data => {
this.setState(state => ({
...state,
Expand All @@ -494,7 +498,7 @@ class App extends Component<

BUN_VERSIONS.forEach(v => {
fetch(`results/bun-${v}.json`)
.then(response => response.json())
.then(response => response.json() as Promise<BenchmarkResponse>)
.then(data => {
this.setState(state => ({
...state,
Expand Down
4 changes: 2 additions & 2 deletions docs/dist/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 028019b

Please sign in to comment.