From 9e80f44892a812b283b10a839cb3ee81c8e2d5d2 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..26744fa 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,27 @@ export const queryClient = new QueryClient({ }, }); ``` + +## Data flow + +### setItem + +```mermaid +flowchart TD + Application([Client app]) --> |".setItem()"| IDBCache[[IDBCache]] + IDBCache -.-> |"Unencrypted chunks"| WebWorker{{Web Worker}} + WebWorker -.-> |"Encrypted chunks"| IDBCache + IDBCache -.-> |"Encrypted chunks"| IndexedDB[(IndexedDB)] +``` + +### getItem + +```mermaid +flowchart TD + Application([Client app]) --> |".getItem()"| IDBCache[[IDBCache]] + IDBCache --> |Get chunks| IndexedDB[(IndexedDB)] + IndexedDB -.-> |Encrypted chunks| IDBCache + IDBCache -.-> |Encrypted chunks| WebWorker{{Web Worker}} + WebWorker -.-> |Decrypted chunks| IDBCache + IDBCache --> |"Item"| Application +``` \ No newline at end of file