-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: Test TypeScript 4.0, 4.1, 4.3
- Loading branch information
Showing
10 changed files
with
100 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig", | ||
"compilerOptions": { | ||
"skipDefaultLibCheck": true, | ||
}, | ||
"include": ["typetest.ts"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useCache, useController, useSuspense } from '@rest-hooks/react'; | ||
|
||
import { queryRemaining, TodoResource } from './src/resources/TodoResource'; | ||
import { UserResource } from './src/resources/UserResource'; | ||
|
||
function useTest() { | ||
const ctrl = useController(); | ||
const payload = { id: 1, title: '', userId: 1 }; | ||
ctrl.fetch(TodoResource.create, payload); | ||
|
||
const todos = useSuspense(TodoResource.getList, { userId: 1 }); | ||
useSuspense(TodoResource.getList); | ||
todos.map((todo) => { | ||
todo.pk(); | ||
todo.title; | ||
ctrl.fetch( | ||
TodoResource.partialUpdate, | ||
{ id: todo.id }, | ||
{ completed: true }, | ||
); | ||
}); | ||
|
||
const remaining = useCache(queryRemaining, { userId: 1 }); | ||
|
||
const users = useSuspense(UserResource.getList); | ||
users.map((user) => { | ||
user.name; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
413dd91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
normalizeLong
284
ops/sec (±0.18%
)293
ops/sec (±0.19%
)1.03
infer All
5548
ops/sec (±0.23%
)5595
ops/sec (±0.24%
)1.01
denormalizeLong
129
ops/sec (±0.92%
)136
ops/sec (±1.07%
)1.05
denormalizeLong with mixin Entity
131
ops/sec (±0.72%
)142
ops/sec (±0.82%
)1.08
denormalizeLong withCache
4019
ops/sec (±1.42%
)4845
ops/sec (±0.87%
)1.21
denormalizeLong All withCache
4812
ops/sec (±0.09%
)4786
ops/sec (±0.11%
)0.99
denormalizeLong Query-sorted withCache
4767
ops/sec (±0.67%
)4816
ops/sec (±0.50%
)1.01
getResponse
4383
ops/sec (±2.82%
)4343
ops/sec (±3.43%
)0.99
getSmallResponse
1787
ops/sec (±3.15%
)1876
ops/sec (±3.15%
)1.05
getSmallInferredResponse
1591
ops/sec (±0.14%
)1570
ops/sec (±0.09%
)0.99
getResponse Query-sorted
440
ops/sec (±1.48%
)461
ops/sec (±1.16%
)1.05
setLong
285
ops/sec (±0.25%
)295
ops/sec (±0.24%
)1.04
setLongWithMerge
119
ops/sec (±0.46%
)123
ops/sec (±0.38%
)1.03
setLongWithSimpleMerge
129
ops/sec (±0.23%
)133
ops/sec (±0.21%
)1.03
This comment was automatically generated by workflow using github-action-benchmark.