FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.51k stars 399 forks source link

Add an option to only enable the query when `enabled` option is set #512

Closed Manokii closed 1 year ago

Manokii commented 2 years ago

Description

Add an option to only do the queries if enabled is set and has truthy value. This behavior is similar to react-query's QueryOptions.enabled

Why?

Sometimes a query might depend on another query

bookchris commented 1 year ago

react-firebase-hooks, useSWR, etc handles this by accepting a null query, which is another option.