diff --git a/patch-db/src/store.rs b/patch-db/src/store.rs index 0241e3e..418f2f6 100644 --- a/patch-db/src/store.rs +++ b/patch-db/src/store.rs @@ -220,6 +220,11 @@ impl PatchDb { pub async fn dump(&self) -> Dump { self.store.read().await.dump() } + pub async fn dump_and_sub(&self) -> (Dump, Receiver>) { + let store = self.store.read().await; + let sub = self.subscriber.subscribe(); + (store.dump(), sub) + } pub async fn exists, V: SegList>( &self, ptr: &JsonPointer,