Commit 8e4c9ec
authored
docs: Improve
## Explanation
`ExampleDataService` is not type checked, so we had missed some type
inference issues. This PR fixes them.
## References
N/A
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test-only example service typing and pagination guards; no production
runtime behavior change.
>
> **Overview**
> Updates **`ExampleDataService.getActivity`** so infinite-query types
infer correctly once the example is type-checked.
>
> **`fetchInfiniteQuery`** no longer passes an explicit
**`GetActivityResponse`** generic; **`initialPageParam`** is **`null as
PageParam`** so **`TPageParam`** lines up with
**`getPreviousPageParam`** / **`getNextPageParam`**. Pagination branches
use **`'after' in pageParam`** and **`'before' in pageParam`** instead
of optional chaining on **`pageParam`**, with eslint disables where the
project restricts that syntax.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f9f85dc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->ExampleDataService types (#10001)1 parent 707eecf commit 8e4c9ec
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
0 commit comments