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

IndexedDB support #36

Open
antonkomarev opened this issue Jan 26, 2019 · 2 comments
Open

IndexedDB support #36

antonkomarev opened this issue Jan 26, 2019 · 2 comments

Comments

@antonkomarev
Copy link

antonkomarev commented Jan 26, 2019

I'm trying to put received resource to IndexedDB:

objectStore.put(project, project.id);

But there is an error:

DataCloneError: The object could not be cloned.

My next try was to represent resource as object valid for cloning, but there is no such method:

project.toObject();

Method toArray applicable only for collections, and not working too:

project.toArray();

So, my questions are:

  1. How to convert resource to valid object to put it to IndexedDB
  2. How to convert it back from stored object after get it from IndexedDB
@nicklandgrebe
Copy link
Owner

This is going to take a bit of time to implement. The easy part is toObject, but getting it back and turning it into a resource is something I've done before personally, but it is not implemented in the core library yet

@antonkomarev
Copy link
Author

@nicklandgrebe maybe we could do this task in 2 steps? It will be much better if there will be toObject converter at least.

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

No branches or pull requests

3 participants