-
-
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
5 changed files
with
57 additions
and
11 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; | ||
}); | ||
} |
d06b950
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
288
ops/sec (±0.15%
)293
ops/sec (±0.19%
)1.02
infer All
5505
ops/sec (±0.29%
)5595
ops/sec (±0.24%
)1.02
denormalizeLong
130
ops/sec (±1.38%
)136
ops/sec (±1.07%
)1.05
denormalizeLong with mixin Entity
140
ops/sec (±0.82%
)142
ops/sec (±0.82%
)1.01
denormalizeLong withCache
4063
ops/sec (±1.73%
)4845
ops/sec (±0.87%
)1.19
denormalizeLong All withCache
4756
ops/sec (±0.09%
)4786
ops/sec (±0.11%
)1.01
denormalizeLong Query-sorted withCache
4745
ops/sec (±0.56%
)4816
ops/sec (±0.50%
)1.01
getResponse
4309
ops/sec (±3.43%
)4343
ops/sec (±3.43%
)1.01
getSmallResponse
1843
ops/sec (±3.06%
)1876
ops/sec (±3.15%
)1.02
getSmallInferredResponse
1691
ops/sec (±0.12%
)1570
ops/sec (±0.09%
)0.93
getResponse Query-sorted
455
ops/sec (±1.60%
)461
ops/sec (±1.16%
)1.01
setLong
286
ops/sec (±0.10%
)295
ops/sec (±0.24%
)1.03
setLongWithMerge
119
ops/sec (±0.45%
)123
ops/sec (±0.38%
)1.03
setLongWithSimpleMerge
129
ops/sec (±0.29%
)133
ops/sec (±0.21%
)1.03
This comment was automatically generated by workflow using github-action-benchmark.