Hi all.
IIUC, the yrs-kvstore crate (and the KVStore trait within it) are all intended for implementing persistence with synchronous methods, right?
I want to implement indexeddb-backed (and yet in Rust, via WASM, because I wanna stay in Rust land in the frontend too) persistence. My understanding is that the JS library from you folks to do this has a promise-based (and hence async) interface, which makes sense, since the underlying IndexedDB API is async at the end of the day.
So what I'm thinking is that I either have to:
- Write a sync wrapper for IndexedDB's async API, or
- Copy
KVStore and DocOpt into my own code and make them support async.
Any advice here? I currently have no idea how to do (1), and yet I'm afraid to go down the path of (2) because it feels like a lot of work.
Thanks for all your work so far and for your help in advance!
Hi all.
IIUC, the yrs-kvstore crate (and the
KVStoretrait within it) are all intended for implementing persistence with synchronous methods, right?I want to implement indexeddb-backed (and yet in Rust, via WASM, because I wanna stay in Rust land in the frontend too) persistence. My understanding is that the JS library from you folks to do this has a promise-based (and hence async) interface, which makes sense, since the underlying IndexedDB API is async at the end of the day.
So what I'm thinking is that I either have to:
KVStoreandDocOptinto my own code and make them support async.Any advice here? I currently have no idea how to do (1), and yet I'm afraid to go down the path of (2) because it feels like a lot of work.
Thanks for all your work so far and for your help in advance!