@basictech/react 0.7.0 → 0.8.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basictech/react",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -24,11 +24,11 @@
24
24
  "dexie-syncable": "^4.0.1-beta.13",
25
25
  "jwt-decode": "^4.0.0",
26
26
  "uuid": "^10.0.0",
27
- "@basictech/schema": "0.6.0"
27
+ "@basictech/schema": "0.7.0-beta.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@repo/typescript-config": "*",
31
- "tsup": "^7.2.0",
31
+ "tsup": "^8.0.0",
32
32
  "typescript": "^5.0.0"
33
33
  },
34
34
  "peerDependencies": {
package/readme.md CHANGED
@@ -137,11 +137,27 @@ const {
137
137
 
138
138
  // Database
139
139
  db, // Database instance
140
- dbStatus, // "OFFLINE" | "CONNECTING" | "ONLINE" | "SYNCING"
140
+ dbStatus, // DBStatus - see below
141
141
  dbMode, // "sync" | "remote"
142
142
  } = useBasic()
143
143
  ```
144
144
 
145
+ #### `DBStatus` (sync connection state)
146
+
147
+ When `dbMode === "sync"`, `dbStatus` is one of:
148
+
149
+ | Value | Description |
150
+ |-------|-------------|
151
+ | `LOADING` | SDK initializing |
152
+ | `OFFLINE` | Not connected |
153
+ | `CONNECTING` | Connecting to sync server |
154
+ | `ONLINE` | Connected and idle |
155
+ | `SYNCING` | Syncing data |
156
+ | `ERROR` | Sync error |
157
+ | `ERROR_WILL_RETRY` | Sync error but client will retry (e.g. expired token). Use this to show "Reconnecting…" or trigger token refresh. |
158
+
159
+ Import the enum for comparisons: `import { useBasic, DBStatus } from '@basictech/react'`.
160
+
145
161
  ---
146
162
 
147
163
  ### `useQuery()`