automerge-repo
automerge-repo copied to clipboard
allow for initial id in repo create
Allows for specified id in repo.create.
One thing: in the conversation about pre-defined ids and about loading from binary, does automerge.from clone the document that is passed in?
I'm wondering if this allows for the following:
const copy = {
content: new Uint8Array([133, 111, 74, 131, ...]),
id: ...
}
const doc = am.load(copy.content)
const handle = repo.create(doc, copy.id)
so that the initial value in repo.create shares ancestry with the binary that is passed in.
Nudge for this functionality! I was just about to write this PR before I saw this... Can provide a hand if needed.
Feel free to jump into this discord thread: https://discord.com/channels/1200006940210757672/1287965416689238047/1288223592936374323 The main blocker is how should we handle conflicting ids.