useBasic
hook is used to access the database and other Basic features.
Any of these properties can be accessed by destructuring the useBasic
hook.
'LOADING'
'CONNECTING'
'ONLINE'
'ERROR_WILL_RETRY'
. If there’s a fatal error, it goes to 'ERROR'
'OFFLINE'
await
or .then()
.isAuthReady
is only triggered upon first render, and not triggered again when the user signs in or out.isAuthReady
boolean is true.useQuery
hook is used to “subscribe” to data from the database, so that it updates when the data changes.
It’s a listener for data, and enables automatic sync between the local database, users’ devices, and all other users that are connected to the same database.
We use it primarily to wrap our .get()
and .getAll()
functions, and it takes a function as an argument.