Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for initial id in repo create #388

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

BrianHung
Copy link

@BrianHung BrianHung commented Sep 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants