assemble runtime crdt state#408
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #408 +/- ##
==========================================
- Coverage 65.42% 65.34% -0.08%
==========================================
Files 125 128 +3
Lines 12253 12750 +497
==========================================
+ Hits 8016 8332 +316
- Misses 4237 4418 +181
☔ View full report in Codecov by Sentry. |
| pub fn new() -> Self { | ||
| Self { | ||
| client_id: rand::random(), | ||
| guid: nanoid!(), | ||
| // share: HashMap::new(), | ||
| store: DocStore::new(), | ||
| } | ||
| } |
Check warning
Code scanning / clippy
you should consider adding a `Default` implementation for `Doc`
| for client_id in client_ids { | ||
| let refs = items.get(&client_id).unwrap(); | ||
| let mut iterator = refs.iter(); | ||
| while let Some(item) = iterator.next() { |
Check warning
Code scanning / clippy
this loop could be written as a `for` loop
In this pr, I implemented the assembly of the crdt item into doc to provide state items that allows the operation of the list/map/text function.
Since store may be used across threads, it means that it needs to be thread-safe.