Skip to content

Commit

Permalink
fix(types): add clear to QueryResultBase (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceloAlves committed Jul 2, 2020
1 parent 7597c1f commit 9a68fed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions types/index.d.ts
Expand Up @@ -286,6 +286,7 @@ export interface QueryResultBase<TResult, TError = Error> {
query: object
updatedAt: number
refetch: ({ throwOnError }?: { throwOnError?: boolean }) => Promise<TResult>
clear: () => void
}

export interface QueryIdleResult<TResult, TError = Error>
Expand Down
2 changes: 2 additions & 0 deletions types/test.ts
Expand Up @@ -74,6 +74,8 @@ function simpleQuery() {
querySimple.fetchMore // $ExpectError

querySimple.canFetchMore // $ExpectType boolean | undefined
querySimple.clear // $ExpectType () => void
querySimple.clear() // $ExpectType void
querySimple.data // $ExpectType string | undefined
querySimple.error // $ExpectType Error | null
querySimple.failureCount // $ExpectType number
Expand Down

0 comments on commit 9a68fed

Please sign in to comment.