CSFrequency / react-firebase-hooks

React Hooks for Firebase.
Apache License 2.0
3.6k stars 306 forks source link

Add ability to retry realtime database hooks in the of an error #204

Closed connor-ricks closed 2 years ago

connor-ricks commented 2 years ago

How can one reevaluate the hook if the hook fails and returns an error?

chrisbianca commented 2 years ago

@Zanchee the Firestore xxxOnce hooks have a manual reload function that gets returned by the hook, but no other hooks do at the moment.

Are there particular hooks where you think this would be useful?

connor-ricks commented 2 years ago

Ahh interesting. The firebase real-time database hooks would be great! Do the non-one time hooks continuously retry if there is an error already? 😊

chrisbianca commented 2 years ago

@Zanchee Having reviewed this one in a bit more detail, the real-time database hooks don't have the equivalent xxxOnce hooks so it's not really possible to add a reload method.

Given the lack of requests for xxxOnce style hook in the real-time database, I'm not going to add this at the moment. If that changes, then I will do with the reload functionality.