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

Syncing compound documents or multiple "typed" items #6

Open
gothy opened this issue Sep 15, 2015 · 0 comments
Open

Syncing compound documents or multiple "typed" items #6

gothy opened this issue Sep 15, 2015 · 0 comments

Comments

@gothy
Copy link

gothy commented Sep 15, 2015

It would be really great to sync a redux-like compound stores.
What I mean is syncing more than a single document which is directly mapped to the db row or smth.
What if data adapter could construct a document we're working on in a dynamic way from a client request(some analogies raise from FB graphql requests) and sync this document's leaves(they could be collections) accordingly.

When you're storing data or retrieving data in data adapter you should specify the leaf name(or tag) you're applying the operation to.

So if your app's state has a list of blogposts, authors, comments connected with each other via some keys, you can implement a post delete via composing operations manually on the client

  • remove items of type 'post' with id 12345
  • remove items of type 'comment' with ids 1,2,3
  • set item data of type 'author' with id 333 with this new value

Maybe diffsync is just not intended to support this kind of things. But this is a solution I'm looking right now for my app. And seems like I'm going to implement this behaviour myself, still I hope you can consider to implement this in the future :)

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