Skip to content

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

Description

@kshitizshankar

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions