db
An app state of the database synchronization.
It can be used to watch the data sync status and errors.
You can obtain the db
state and integrate it with React components.
Data Structure
- Name
isSyncing
- Type
- boolean | undefined
- Description
true
if the database is currently syncing.undefined
if it has not ever been synced yet since the app launched.
- Name
lastSyncTime
- Type
- number | null | undefined
- Description
The last datetime when the database finished syncing.
undefined
if it has not ever been synced yet since the app launched.
- Name
lastSyncError
- Type
- Error | null | undefined
- Description
The last error ocurred while syncing.
Get the db
state manually:
const { db } = inkdrop.store.getState()
Connect the state with your React component:
import { useSelector } from 'react-redux'
const selector = ({ db }) => db
const MyComponent = props => {
const db = useSelector(selector)
// render
}