IndexedDB support
Opened this issue · 2 comments
antonkomarev commented
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:
- How to convert resource to valid object to
put
it to IndexedDB - How to convert it back from stored object after
get
it from IndexedDB
nicklandgrebe commented
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 commented
@nicklandgrebe maybe we could do this task in 2 steps? It will be much better if there will be toObject
converter at least.