You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The adapter layer exists so application code is not tightly bound to Dexie.
21
+
Components and hooks must use feature-level storage utilities. Native
22
+
`localStorage`, `sessionStorage`, and IndexedDB access belong only in these
23
+
storage implementations, migrations, or black-box test setup.
14
24
15
-
## Adapter Lifecycle
25
+
## Offline Data Store Lifecycle
16
26
17
-
`initializeStorage()` does this:
27
+
`initializeOfflineDataStore()` does this:
18
28
19
-
1. lazily create the storage adapter singleton
29
+
1. lazily create the offline data store singleton
20
30
2. open the underlying IndexedDB database
21
-
3. run adapter-level schema upgrades
31
+
3. run store-level schema upgrades
22
32
4. run app-level data migrations
23
33
5. run app-level external import migrations
24
34
25
35
The initialization call is idempotent and memoized by `initPromise`.
26
36
27
-
For tests that instantiate `IndexedDBAdapter` directly, call `adapter.close()` during teardown before deleting the test database. This closes the Dexie connection and resets adapter readiness state for the next test.
37
+
For tests that instantiate `IndexedDbOfflineDataStore` directly, call
38
+
`store.close()` during teardown before deleting the test database. This closes
39
+
the Dexie connection and resets readiness state for the next test.
28
40
29
41
## IndexedDB Schema
30
42
@@ -38,7 +50,7 @@ Current table groups:
38
50
-`tasks`
39
51
-`_migrations`
40
52
41
-
The IndexedDB adapter keeps:
53
+
The IndexedDB store keeps:
42
54
43
55
- events keyed by `_id`
44
56
- tasks keyed by `_id` and associated to a `dateKey`
0 commit comments