-
Notifications
You must be signed in to change notification settings - Fork 306
Closed
Description
Firstly, thanks for the great library :) I'm trying to use it with typescript but the return type from all the firebase hooks are returning errors typed as Error
rather than FirestoreError
. For example
// useCollection.ts
export type CollectionHook = LoadingHook<firestore.QuerySnapshot, Error>;
...
const { error, loading, reset, setError, setValue, value } = useLoadingValue<
firestore.QuerySnapshot,
Error
>();
The error objects themselves though are Firebase Errors (as they have the code
attribute).
This seems to have had been fixed in v1 with #18 but are now back to Error
type in V2. Not sure if this was intentional or not, if not and it should be typed as FirestoreError
I'd be more than happy to submit a pull request
Metadata
Metadata
Assignees
Labels
No labels