diff --git a/README.md b/README.md index 1045643..5a0709c 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,27 @@ export const queryClient = new QueryClient({ }, }); ``` + +## Data flow + +### getItem + +```mermaid +flowchart TD + Application([Browser]) --> |"Get item"| IDBCache[[IDBCache]] + IDBCache --> |Get chunks| IndexedDB[(IndexedDB)] + IndexedDB -.-> |Encrypted chunks| IDBCache + IDBCache -.-> |Encrypted chunks| WebWorker{{Web Worker}} + WebWorker -.-> |Decrypted chunks| IDBCache + IDBCache -.-> |"Item"| Application +``` + +### setItem + +```mermaid +flowchart TD + Application([Browser]) --> |"Set item"| IDBCache[[IDBCache]] + IDBCache -.-> |"Unencrypted chunks"| WebWorker{{Web Worker}} + WebWorker -.-> |"Encrypted chunks"| IDBCache + IDBCache -.-> |"Encrypted chunks"| IndexedDB[(IndexedDB)] +``` \ No newline at end of file