Skip to content

Support for async persistence mechanisms? (what I really want is indexeddb-backed persistence in wasm). #5

@dnaaun

Description

@dnaaun

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:

  1. Write a sync wrapper for IndexedDB's async API, or
  2. 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!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions