From 095b55acf199627791ad5af5d01643bb1e1c5bb9 Mon Sep 17 00:00:00 2001 From: Aaron Shafovaloff Date: Sun, 17 Nov 2024 22:34:24 -0700 Subject: [PATCH] Add data flow to README --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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