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

[Question] How do I initialise my array with values from the db? #11

Open
kshitizshankar opened this issue May 28, 2018 · 0 comments
Open

Comments

@kshitizshankar
Copy link

Hey,
Sorry if this is a noob question - I recently started exploring Y-JS for a prototype where I need to sync JSON objects across multiple sessions.
Something like -

let t = {
"p1" : ["ABC", "DEF"],
"p2" : ["ABC", "DEF"]
}

Users can edit the content of the array ("ABC") from the front-end.

I have been able to set up the library but I can't seem to figure out how to initialize the y.share.array with initial values from the database. Can you please point me in the right direction on what would be the best way to do that?

Thanks a lot.

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

No branches or pull requests

1 participant