YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.73k stars 52 forks source link

How to handle relations #113

Closed andrezimpel closed 11 months ago

andrezimpel commented 1 year ago

First of all awesome project, thank you! I was wondering how to implement nested objects. Say there are todo lists that have todos. a todo has an assignee. An assignee is a user within my app.

What if the users edits his/her name, it would not automatically be reflected in the doc.

How would I handle this situation?

YousefED commented 11 months ago

I would create the following structure:

{ 
users: {
<id>: { userdata}
},
todos: [
title: "text",
completed: true,
author: <id>
]
}