Skip to content
This repository was archived by the owner on Aug 29, 2020. It is now read-only.

Commit 8c30122

Browse files
committed
Add separate AbortController for getPlaceDetails function + add cancelQuery function
1 parent 1ca8fd8 commit 8c30122

File tree

5 files changed

+133
-57
lines changed

5 files changed

+133
-57
lines changed

index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ export interface AutocompleteProps {
1616
}
1717

1818
interface ReturnProps {
19-
results: []
19+
results: {
20+
predictions: any[]
21+
status: string
22+
}
2023
isLoading: boolean
2124
error: null | string
2225
getPlaceDetails: any
26+
cancelQuery: (id: string) => void
2327
}
2428

2529
declare module 'use-google-autocomplete' {

lib/use-google-autocomplete.js

Lines changed: 55 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/use-google-autocomplete.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "use-google-autocomplete",
3-
"version": "0.0.5",
3+
"version": "0.0.8",
44
"description": "A tiny React Hook that returns Google Autocomplete results, with session_token handling.",
55
"keywords": [
66
"google maps",

0 commit comments

Comments
 (0)