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

Schema.prototype.registerAllKeys fails with data from localstorage #80

Closed
MaKleSoft opened this issue Jan 6, 2015 · 1 comment
Closed

Comments

@MaKleSoft
Copy link

When trying to load existing data from LocalStorageSource, I'm getting an undefined is not a function in this line: https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/schema.js#L418

The problem is that Schema.prototype.registerAllKeys tries to call forEach on an a plain object. Apparently there is a discrepancy between what the function expects as data and what LocalStorageSource actually provides. Specifically, the function seems to expect an array for each model while LocalStorageSource provides an object mapping ids to model objects.

@dgeb
Copy link
Member

dgeb commented Jun 16, 2016

This code has been completely rewritten. Please open a fresh issue if you have further problems.

@dgeb dgeb closed this as completed Jun 16, 2016
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

2 participants