-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
Describe the bug
QueryResult has a lot of generic types when more specific types could be used to make code easier to write and less assertions/checks necessary to use the various return values. For example, if isSuccess === true then data will never be undefined. If isError === true then error will never be null, etc.
To Reproduce
Not sure about repro steps since this is a TypeScript issue/improvement.
Expected behavior
I'd expect the QueryResult type to be one of several distinct types for each of the possible combinations. This means that if isSuccess is true, then is* will be false and every other combination similar.
Screenshots
N/A
Additional context
N/A
Metadata
Metadata
Assignees
Labels
No labels